mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 09:52:22 +00:00
Merge branch 'master' into feature-16370/AkteLib_create_new_CI_library_to_handle_akte
This commit is contained in:
@@ -188,7 +188,7 @@ class AnrechnungJob extends JOB_Controller
|
||||
$studiengang_bezeichnung = $this->StudiengangModel->load($studiengang_kz)->retval[0]->stg_bezeichnung;
|
||||
|
||||
// Get STGL mail address
|
||||
list ($to, $vorname) = self::_getSTGLMailAddress($studiengang_kz);
|
||||
$stglMailReceiver_arr = self::_getSTGLMailAddress($studiengang_kz);
|
||||
|
||||
// Get HTML table with new Anrechnungen of that STG plus amount of them
|
||||
list ($anrechnungen_amount, $anrechnungen_table) = self::_getSTGLMailDataTable($studiengang_kz, $anrechnungen);
|
||||
@@ -199,22 +199,25 @@ class AnrechnungJob extends JOB_Controller
|
||||
CIS_ROOT. 'cis/menu.php?content_id=&content='.
|
||||
CIS_ROOT. index_page(). self::APPROVE_ANRECHNUNG_URI;
|
||||
|
||||
foreach ($stglMailReceiver_arr as $stgl)
|
||||
{
|
||||
// Prepare mail content
|
||||
$body_fields = array(
|
||||
'vorname' => $vorname,
|
||||
'studiengang' => $studiengang_bezeichnung,
|
||||
'anzahl' => $anrechnungen_amount,
|
||||
'datentabelle' => $anrechnungen_table,
|
||||
'link' => anchor($url, 'Anrechnungsanträge Übersicht')
|
||||
);
|
||||
|
||||
// Send mail
|
||||
sendSanchoMail(
|
||||
'AnrechnungAntragStellen',
|
||||
$body_fields,
|
||||
$to,
|
||||
'Anerkennung nachgewiesener Kenntnisse: Neuer Antrag wurde gestellt'
|
||||
);
|
||||
$body_fields = array(
|
||||
'vorname' => $stgl['vorname'],
|
||||
'studiengang' => $studiengang_bezeichnung,
|
||||
'anzahl' => $anrechnungen_amount,
|
||||
'datentabelle' => $anrechnungen_table,
|
||||
'link' => anchor($url, 'Anrechnungsanträge Übersicht')
|
||||
);
|
||||
|
||||
// Send mail
|
||||
sendSanchoMail(
|
||||
'AnrechnungAntragStellen',
|
||||
$body_fields,
|
||||
$stgl['to'],
|
||||
'Anerkennung nachgewiesener Kenntnisse: Neuer Antrag wurde gestellt'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$this->logInfo('SUCCEDED: Sending emails to STGL about yesterdays new Anrechnungen succeded.');
|
||||
@@ -342,15 +345,21 @@ html;
|
||||
// Get STGL mail address
|
||||
private function _getSTGLMailAddress($studiengang_kz)
|
||||
{
|
||||
$stglMailAdress_arr = array();
|
||||
$result = $this->StudiengangModel->getLeitung($studiengang_kz);
|
||||
|
||||
// Get STGL mail address
|
||||
if (hasData($result))
|
||||
{
|
||||
return array(
|
||||
$result->retval[0]->uid. '@'. DOMAIN,
|
||||
$result->retval[0]->vorname
|
||||
);
|
||||
foreach (getData($result) as $stgl)
|
||||
{
|
||||
$stglMailAdress_arr[]= array(
|
||||
'to' => $stgl->uid. '@'. DOMAIN,
|
||||
'vorname' => $stgl->vorname
|
||||
);
|
||||
}
|
||||
|
||||
return $stglMailAdress_arr;
|
||||
}
|
||||
// If not available, get assistance mail address
|
||||
else
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Job for resolving core issues
|
||||
*/
|
||||
class IssueResolver extends IssueResolver_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// set fehler codes which can be resolved by the job
|
||||
// structure: fehlercode => class (library) name for resolving
|
||||
$this->_codeLibMappings = array(
|
||||
'CORE_ZGV_0001' => 'CORE_ZGV_0001',
|
||||
'CORE_ZGV_0002' => 'CORE_ZGV_0002',
|
||||
'CORE_ZGV_0003' => 'CORE_ZGV_0003',
|
||||
'CORE_ZGV_0004' => 'CORE_ZGV_0004',
|
||||
'CORE_ZGV_0005' => 'CORE_ZGV_0005',
|
||||
'CORE_INOUT_0001' => 'CORE_INOUT_0001',
|
||||
'CORE_INOUT_0002' => 'CORE_INOUT_0002',
|
||||
'CORE_INOUT_0003' => 'CORE_INOUT_0003',
|
||||
'CORE_INOUT_0004' => 'CORE_INOUT_0004',
|
||||
'CORE_INOUT_0005' => 'CORE_INOUT_0005',
|
||||
'CORE_INOUT_0006' => 'CORE_INOUT_0006'
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@
|
||||
*/
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class LVPlanJob extends CLI_Controller
|
||||
class LVPlanJob extends JOB_Controller
|
||||
{
|
||||
/**
|
||||
* Initialize LVPlanJob Class
|
||||
@@ -149,4 +149,313 @@ class LVPlanJob extends CLI_Controller
|
||||
echo "Failed ".$fail."\n";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Send Mail to STGL, Kompetenzfeld and LV Planung about todays updated Zeitwuensche.
|
||||
* STGL gets list only of lectors who updated future assigend courses concerning their STG.
|
||||
* Kompetenzleitung gets list only of lectors who updated future assigend courses concerning their KF.
|
||||
* LVPlanung gets list of lectors who updated future assigend courses.
|
||||
*/
|
||||
public function mailUpdatedZeitwuensche()
|
||||
{
|
||||
// Load models
|
||||
$this->load->model('ressource/Stundenplandev_model', 'StundenplandevModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StundiensemesterModel');
|
||||
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
|
||||
// Load libs
|
||||
$this->load->library('MailLib');
|
||||
|
||||
// Load helpers
|
||||
$this->load->helper('hlp_sancho_helper');
|
||||
|
||||
// Start Log Message
|
||||
$this->logInfo('Mail updated Zeitwuensche started.');
|
||||
|
||||
// Get all lectors, who updated their Zeitwunsch today
|
||||
$db = new DB_Model();
|
||||
$result = $db->execReadOnlyQuery('
|
||||
SELECT
|
||||
zwg.mitarbeiter_uid, tbl_lehrveranstaltung.studiengang_kz, tbl_lehrveranstaltung.oe_kurzbz
|
||||
FROM
|
||||
campus.tbl_zeitwunsch_gueltigkeit zwg
|
||||
JOIN lehre.tbl_stundenplandev stpl
|
||||
ON(
|
||||
stpl.mitarbeiter_uid=zwg.mitarbeiter_uid
|
||||
AND stpl.datum BETWEEN zwg.von AND COALESCE(zwg.bis, \'2999-12-31\')
|
||||
AND (zwg.insertamum::date = (NOW()-\'1 days\'::interval)::date
|
||||
OR
|
||||
zwg.updateamum::date = (NOW()-\'1 days\'::interval)::date)
|
||||
AND stpl.datum > now()
|
||||
)
|
||||
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
|
||||
JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
GROUP BY
|
||||
zwg.mitarbeiter_uid, tbl_lehrveranstaltung.studiengang_kz, tbl_lehrveranstaltung.oe_kurzbz
|
||||
');
|
||||
|
||||
if (!hasData($result))
|
||||
{
|
||||
return; // No updated Zeitwuensche today
|
||||
}
|
||||
|
||||
$uidByStg_arr = array(); // Mail data for Studiengang
|
||||
$uidByOe_arr = array(); // Mail data for Kompetenzfeld
|
||||
$uid_arr = array(); // Mail data for Kompetenzfeld
|
||||
|
||||
// Loop through lectors, who updated their Zeitwunsch today
|
||||
$changed_arr = getData($result);
|
||||
foreach ($changed_arr as $row)
|
||||
{
|
||||
|
||||
// Add unique lector array
|
||||
if (!in_array($row->mitarbeiter_uid, $uid_arr))
|
||||
{
|
||||
$uid_arr[]= $row->mitarbeiter_uid;
|
||||
}
|
||||
|
||||
// Build unique Studiengang array
|
||||
if (!array_key_exists($row->studiengang_kz, $uidByStg_arr))
|
||||
{
|
||||
$uidByStg_arr[$row->studiengang_kz] = array($row->mitarbeiter_uid);
|
||||
|
||||
}
|
||||
elseif (!in_array($row->mitarbeiter_uid, $uidByStg_arr[$row->studiengang_kz]))
|
||||
{
|
||||
$uidByStg_arr[$row->studiengang_kz][]= $row->mitarbeiter_uid;
|
||||
}
|
||||
|
||||
// Build unique Kompetenzfeld array
|
||||
if (!array_key_exists($row->oe_kurzbz, $uidByOe_arr))
|
||||
{
|
||||
$uidByOe_arr[$row->oe_kurzbz] = array($row->mitarbeiter_uid);
|
||||
|
||||
}
|
||||
elseif (!in_array($row->mitarbeiter_uid, $uidByOe_arr[$row->oe_kurzbz]))
|
||||
{
|
||||
$uidByOe_arr[$row->oe_kurzbz][]= $row->mitarbeiter_uid;
|
||||
}
|
||||
}
|
||||
|
||||
// Send mail to STG Assistenz
|
||||
$result = $this->_sendMailToStg($uidByStg_arr);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->logError(getError($result));
|
||||
}
|
||||
|
||||
// Send mail to Kompetenzfeld Leitung
|
||||
$result = $this->_sendMailToKF($uidByOe_arr);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->logError(getError($result));
|
||||
}
|
||||
|
||||
// Send mail to LV Planung
|
||||
$result = $this->_sendMailToLvPlanung($uid_arr);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->logError(getError($result));
|
||||
}
|
||||
|
||||
// End Log Message
|
||||
$this->logInfo('Mail updated Zeitwuensche ended.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Send Mail to STGL Assistance about lectors, who teach LV assigend to the STG, and who updated Zeitwuensche.
|
||||
*
|
||||
* @param $data_arr
|
||||
* @param $stg_bezeichnung
|
||||
*/
|
||||
private function _sendMailToStg($data_arr)
|
||||
{
|
||||
foreach ($data_arr as $stg_kurzbz => $uid_arr)
|
||||
{
|
||||
// Get STG eMail
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$result = $this->StudiengangModel->load($stg_kurzbz);
|
||||
$stgMail = $result->retval[0]->email;
|
||||
|
||||
$lektorenTabelle = '
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th style="text-align:left">Name</th>
|
||||
<th style="text-align:left">UID</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
';
|
||||
|
||||
foreach($uid_arr as $uid)
|
||||
{
|
||||
$person = $this->PersonModel->getByUid($uid);
|
||||
$lektorenTabelle.= '
|
||||
<tr>
|
||||
<td style="text-align:left">'. getData($person)[0]->vorname. ' '. getData($person)[0]->nachname. '</td>
|
||||
<td style="text-align:left">['. $uid. ']</td>
|
||||
</tr>
|
||||
';
|
||||
}
|
||||
|
||||
$lektorenTabelle.= '</tbody></table>';
|
||||
|
||||
$contentData_arr = array(
|
||||
'datentabelle' => $lektorenTabelle
|
||||
);
|
||||
|
||||
// Send mail
|
||||
if (!sendSanchoMail(
|
||||
'ZeitwunschUpdateMail',
|
||||
$contentData_arr,
|
||||
$stgMail,
|
||||
'Änderung von Zeitwünschen',
|
||||
'sancho_header_min_bw.jpg',
|
||||
'sancho_footer_min_bw.jpg'
|
||||
))
|
||||
{
|
||||
$errorReceiverUid_arr[]= $stgMail;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($errorReceiverUid_arr))
|
||||
{
|
||||
return error('Mail updated Zeitwuensche could not be sent to :'. implode($errorReceiverUid_arr, ','));
|
||||
}
|
||||
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* Send Mail to Kompetenzfeld about lectors, who teach LV assigend to the Kompetenzfeld, and who updated Zeitwuensche.
|
||||
*
|
||||
* @param $data_arr
|
||||
* @param $stg_bezeichnung
|
||||
*/
|
||||
private function _sendMailToKF($data_arr)
|
||||
{
|
||||
// Send mail to Komepetenzfeld Leitung
|
||||
foreach ($data_arr as $oe_kurzbz => $uid_arr)
|
||||
{
|
||||
// Get KF Leitung eMail
|
||||
$this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
$result = $this->BenutzerfunktionModel->getBenutzerFunktionen(
|
||||
'Leitung',
|
||||
$oe_kurzbz,
|
||||
$activeoeonly = true,
|
||||
$activebenonly = true
|
||||
);
|
||||
|
||||
if(isSuccess($result) && hasData($result))
|
||||
{
|
||||
$empfaenger = array();
|
||||
|
||||
foreach(getData($result) as $row)
|
||||
$empfaenger[] = $row->uid. '@'. DOMAIN;
|
||||
$kfMail = implode(',',$empfaenger);
|
||||
|
||||
$lektorenTabelle = '
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th style="text-align:left">Name</th>
|
||||
<th style="text-align:left">UID</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
';
|
||||
|
||||
foreach($uid_arr as $uid)
|
||||
{
|
||||
$person = $this->PersonModel->getByUid($uid);
|
||||
$lektorenTabelle.= '
|
||||
<tr>
|
||||
<td style="text-align:left">'. getData($person)[0]->vorname. ' '. getData($person)[0]->nachname. '</td>
|
||||
<td style="text-align:left">['. $uid. ']</td>
|
||||
</tr>
|
||||
';
|
||||
}
|
||||
|
||||
$lektorenTabelle.= '</tbody></table>';
|
||||
|
||||
$contentData_arr = array(
|
||||
'datentabelle' => $lektorenTabelle
|
||||
);
|
||||
|
||||
// Send mail
|
||||
if (!sendSanchoMail(
|
||||
'ZeitwunschUpdateMail',
|
||||
$contentData_arr,
|
||||
$kfMail,
|
||||
'Änderung von Zeitwünschen',
|
||||
'sancho_header_min_bw.jpg',
|
||||
'sancho_footer_min_bw.jpg'
|
||||
))
|
||||
{
|
||||
$errorReceiverUid_arr[]= $kfMail;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($errorReceiverUid_arr))
|
||||
{
|
||||
return error('Mail updated Zeitwuensche could not be sent to :'. implode($errorReceiverUid_arr, ','));
|
||||
}
|
||||
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* Send Mail to LV Planung about all lectors who updated Zeitwuensche.
|
||||
*
|
||||
* @param $data_arr
|
||||
* @param $stg_bezeichnung
|
||||
*/
|
||||
private function _sendMailToLvPlanung($data_arr)
|
||||
{
|
||||
$lektorenTabelle = '
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th style="text-align:left">Name</th>
|
||||
<th style="text-align:left">UID</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
';
|
||||
|
||||
foreach($data_arr as $lector)
|
||||
{
|
||||
$person = $this->PersonModel->getByUid($lector);
|
||||
$lektorenTabelle.= '
|
||||
<tr>
|
||||
<td style="text-align:left">'. getData($person)[0]->vorname. ' '. getData($person)[0]->nachname. '</td>
|
||||
<td style="text-align:left">['. $lector. ']</td>
|
||||
</tr>
|
||||
';
|
||||
}
|
||||
|
||||
$lektorenTabelle.= '</tbody></table>';
|
||||
|
||||
$contentData_arr = array(
|
||||
'datentabelle' => $lektorenTabelle
|
||||
);
|
||||
|
||||
// Send mail
|
||||
if (!sendSanchoMail(
|
||||
'ZeitwunschUpdateMail',
|
||||
$contentData_arr,
|
||||
MAIL_LVPLAN,
|
||||
'Änderung von Zeitwünschen',
|
||||
'sancho_header_min_bw.jpg',
|
||||
'sancho_footer_min_bw.jpg'
|
||||
))
|
||||
{
|
||||
$errorReceiver = MAIL_LVPLAN;
|
||||
}
|
||||
|
||||
if (isset($errorReceiver))
|
||||
{
|
||||
return error('Mail updated Zeitwuensche could not be sent to :'. $errorReceiver);
|
||||
}
|
||||
|
||||
return success();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
@@ -416,32 +421,22 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
{
|
||||
$result = $this->AnrechnungModel->load($anrechnung_id);
|
||||
|
||||
if(!$result = getData($result)[0])
|
||||
if(!hasData($result))
|
||||
{
|
||||
show_error('Failed loading Anrechnung');
|
||||
}
|
||||
|
||||
|
||||
$result = $this->LehrveranstaltungModel->loadWhere(array(
|
||||
'lehrveranstaltung_id' => $result->lehrveranstaltung_id
|
||||
'lehrveranstaltung_id' => getData($result)[0]->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 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');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -461,23 +456,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,44 +5,45 @@ 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';
|
||||
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
|
||||
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'
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
// Load models
|
||||
$this->load->model('education/Anrechnung_model', 'AnrechnungModel');
|
||||
$this->load->model('education/Anrechnungstatus_model', 'AnrechnungstatusModel');
|
||||
$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(
|
||||
@@ -54,37 +55,46 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
'table'
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$this->_setAuthUID();
|
||||
|
||||
|
||||
$this->setControllerId();
|
||||
}
|
||||
|
||||
|
||||
public function index()
|
||||
{
|
||||
// Get study semester
|
||||
$studiensemester_kurzbz = $this->input->get('studiensemester');
|
||||
|
||||
|
||||
if (isEmptyString($studiensemester_kurzbz))
|
||||
{
|
||||
$result = $this->StudiensemesterModel->getNearest();
|
||||
$studiensemester_kurzbz = getData($result)[0]->studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
|
||||
// Get studiengaenge the user is entitled for
|
||||
if (!$studiengang_kz_arr = $this->permissionlib->getSTG_isEntitledFor(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN))
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Approve Anrechnungen.
|
||||
*/
|
||||
@@ -97,7 +107,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
{
|
||||
return $this->outputJsonError('Fehler beim Übertragen der Daten.');
|
||||
}
|
||||
|
||||
|
||||
// Approve Anrechnung
|
||||
foreach ($data as $item)
|
||||
{
|
||||
@@ -110,7 +120,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Output json to ajax
|
||||
if (isset($json) && !isEmptyArray($json))
|
||||
{
|
||||
@@ -121,20 +131,20 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
return $this->outputJsonError('Es wurden keine Anrechnungen genehmigt.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reject Anrechnungen.
|
||||
*/
|
||||
public function reject()
|
||||
{
|
||||
$data = $this->input->post('data');
|
||||
|
||||
|
||||
// Validate data
|
||||
if (isEmptyArray($data))
|
||||
{
|
||||
return $this->outputJsonError('Fehler beim Übertragen der Daten.');
|
||||
}
|
||||
|
||||
|
||||
// Reject Anrechnung
|
||||
foreach ($data as $item)
|
||||
{
|
||||
@@ -147,7 +157,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Output json to ajax
|
||||
if (isset($json) && !isEmptyArray($json))
|
||||
{
|
||||
@@ -158,22 +168,22 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
return $this->outputJsonError('Es wurden keine Anrechnungen genehmigt.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Request recommendation for Anrechnungen.
|
||||
*/
|
||||
public function requestRecommendation()
|
||||
{
|
||||
$data = $this->input->post('data');
|
||||
|
||||
|
||||
if(isEmptyArray($data))
|
||||
{
|
||||
return $this->outputJsonError('Fehler beim Übertragen der Daten.');
|
||||
}
|
||||
|
||||
|
||||
$retval = array();
|
||||
$counter = 0;
|
||||
|
||||
|
||||
foreach ($data as $item)
|
||||
{
|
||||
// Check if Anrechnungs-LV has lector
|
||||
@@ -181,7 +191,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
{
|
||||
// Count up LV with no lector
|
||||
$counter++;
|
||||
|
||||
|
||||
// Continue loop, if LV has no lector
|
||||
continue;
|
||||
}
|
||||
@@ -195,7 +205,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
$empfehlungsanfrage_an = !isEmptyArray($lector_arr)
|
||||
? implode(', ', array_column($lector_arr, 'fullname'))
|
||||
: '';
|
||||
|
||||
|
||||
$retval[]= array(
|
||||
'anrechnung_id' => $item['anrechnung_id'],
|
||||
'status_kurzbz' => self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR,
|
||||
@@ -206,7 +216,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send mails to lectors
|
||||
* NOTE: mails are sent at the end to ensure sending only ONE mail to each LV-Leitung or lector
|
||||
@@ -216,13 +226,13 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
{
|
||||
self::_sendSanchoMailToLectors($retval);
|
||||
}
|
||||
|
||||
|
||||
// Output json to ajax
|
||||
if (isEmptyArray($retval) && $counter == 0)
|
||||
{
|
||||
return $this->outputJsonError('Es wurden keine Empfehlungen angefordert');
|
||||
}
|
||||
|
||||
|
||||
return $this->outputJsonSuccess($retval);
|
||||
}
|
||||
|
||||
@@ -240,7 +250,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
|
||||
// Check if user is entitled to read dms doc
|
||||
$this->_checkIfEntitledToReadDMSDoc($dms_id);
|
||||
|
||||
|
||||
// Set filename to be used on downlaod
|
||||
$filename = $this->anrechnunglib->setFilenameOnDownload($dms_id);
|
||||
|
||||
@@ -258,10 +268,10 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
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
|
||||
@@ -284,20 +294,15 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
show_error('Failed loading Lehrveranstaltung');
|
||||
}
|
||||
|
||||
// Get STGL
|
||||
$result = $this->StudiengangModel->getLeitung($result->studiengang_kz);
|
||||
$studiengang_kz = $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');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send mail to lectors asking for recommendation. (first to LV-Leitung, if not present to all lectors of lv)
|
||||
* @param $mail_params
|
||||
@@ -307,7 +312,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
{
|
||||
// Get Lehrveranstaltungen
|
||||
$anrechnung_arr = array();
|
||||
|
||||
|
||||
foreach ($mail_params as $item)
|
||||
{
|
||||
$this->AnrechnungModel->addSelect('lehrveranstaltung_id, studiensemester_kurzbz');
|
||||
@@ -316,10 +321,10 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
'studiensemester_kurzbz' => $this->AnrechnungModel->load($item['anrechnung_id'])->retval[0]->studiensemester_kurzbz
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$anrechnung_arr = array_unique($anrechnung_arr, SORT_REGULAR);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get lectors (prio for LV-Leitung, if not present to all lectors of LV.
|
||||
* Anyway this function will receive a unique array to avoid sending more mails to one and the same lector.
|
||||
@@ -331,27 +336,27 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
{
|
||||
$to = $lector->uid;
|
||||
$vorname = $lector->vorname;
|
||||
|
||||
|
||||
// Get full name of stgl
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
if (!$stgl_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::REVIEW_ANRECHNUNG_URI;
|
||||
|
||||
|
||||
// Prepare mail content
|
||||
$body_fields = array(
|
||||
'vorname' => $vorname,
|
||||
'stgl_name' => $stgl_name,
|
||||
'link' => anchor($url, 'Anrechnungsanträge Übersicht')
|
||||
);
|
||||
|
||||
|
||||
sendSanchoMail(
|
||||
'AnrechnungEmpfehlungAnfordern',
|
||||
$body_fields,
|
||||
@@ -361,7 +366,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get lectors (prio for LV-Leitung, if not present to all lectors of LV.
|
||||
* Anyway this function will receive a unique array to avoid sending more mails to one and the same lector.
|
||||
@@ -371,33 +376,34 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
private function _getLectors($anrechnung_arr)
|
||||
{
|
||||
$lector_arr = array();
|
||||
|
||||
|
||||
// Get lectors
|
||||
foreach($anrechnung_arr as $anrechnung)
|
||||
{
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$result = $this->LehrveranstaltungModel->getLecturersByLv($anrechnung['studiensemester_kurzbz'], $anrechnung['lehrveranstaltung_id']);
|
||||
|
||||
if (!$result = getData($result))
|
||||
|
||||
if (!hasData($result))
|
||||
{
|
||||
show_error('Failed retrieving lectors of Lehrveranstaltung');
|
||||
}
|
||||
|
||||
|
||||
$lecturersByLv = getData($result);
|
||||
|
||||
// Check if lv has LV-Leitung
|
||||
$key = array_search(true, array_column($result, 'lvleiter'));
|
||||
|
||||
$key = array_search(true, array_column($lecturersByLv, 'lvleiter'));
|
||||
// If lv has LV-Leitung, keep only the one
|
||||
if ($key !== false)
|
||||
{
|
||||
$lector_arr[]= $result[$key];
|
||||
$lector_arr[]= $lecturersByLv[$key];
|
||||
}
|
||||
// ...otherwise keep all lectors
|
||||
else
|
||||
{
|
||||
$lector_arr = array_merge($lector_arr, $result);
|
||||
$lector_arr = array_merge($lector_arr, $lecturersByLv);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* NOTE: This step is only done to make the array unique by uid, vorname and nachname in the following step
|
||||
* (e.g. if same lector is ones LV-Leitung and another time not, then array_unique would leave both.
|
||||
@@ -407,10 +413,10 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
{
|
||||
unset($lector->lvleiter);
|
||||
}
|
||||
|
||||
|
||||
// Now make the lector array aka mail receivers unique
|
||||
$lector_arr = array_unique($lector_arr, SORT_REGULAR);
|
||||
|
||||
|
||||
return $lector_arr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ class requestAnrechnung extends Auth_Controller
|
||||
$prestudent_id = getData($result)[0]->prestudent_id;
|
||||
|
||||
// Check if application deadline is expired
|
||||
$is_expired = self::_checkAntragDeadline(
|
||||
$is_expired = self::_isExpired(
|
||||
$this->config->item('submit_application_start'),
|
||||
$this->config->item('submit_application_end'),
|
||||
$studiensemester_kurzbz
|
||||
@@ -119,7 +119,7 @@ class requestAnrechnung extends Auth_Controller
|
||||
// Validate data
|
||||
if (empty($_FILES['uploadfile']['name']))
|
||||
{
|
||||
return $this->outputJsonError($this->p->t('ui', 'errorUploadFehlt'));
|
||||
return $this->outputJsonError($this->p->t('ui', 'errorUploadFehltOderZuGross'));
|
||||
}
|
||||
|
||||
if (isEmptyString($begruendung_id) ||
|
||||
@@ -231,10 +231,10 @@ class requestAnrechnung extends Auth_Controller
|
||||
* @param $start Start date for application submission.
|
||||
* @param $ende End date for application submission.
|
||||
* @param $studiensemester_kurzbz
|
||||
* @return bool True if today is not during the start- and ending deadlines (= if is expired)
|
||||
* @return bool True if deadline is expired
|
||||
* @throws Exception
|
||||
*/
|
||||
private function _checkAntragDeadline($start, $ende, $studiensemester_kurzbz)
|
||||
private function _isExpired($start, $ende, $studiensemester_kurzbz)
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
@@ -258,8 +258,8 @@ class requestAnrechnung extends Auth_Controller
|
||||
$start = new DateTime($start);
|
||||
$ende = new DateTime($ende);
|
||||
|
||||
// True if today is not during the start- and ending deadlines (= if is expired)
|
||||
return ($today <= $start || $today >= $ende);
|
||||
// True if expired
|
||||
return ($today < $start || $today > $ende);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -329,8 +329,8 @@ class requestAnrechnung extends Auth_Controller
|
||||
private function _LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id)
|
||||
{
|
||||
// Get Note of Lehrveranstaltung
|
||||
$this->load->model('education/Lvgesamtnote_model', 'LvgesamtnoteModel');
|
||||
$result = $this->LvgesamtnoteModel->load(array(
|
||||
$this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
|
||||
$result = $this->ZeugnisnoteModel->load(array(
|
||||
'student_uid' => $this->_uid,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'lehrveranstaltung_id' => $lehrveranstaltung_id
|
||||
|
||||
@@ -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
|
||||
$this->_checkIfEntitledToReadDMSDoc($dms_id);
|
||||
|
||||
|
||||
// Set filename to be used on downlaod
|
||||
$filename = $this->anrechnunglib->setFilenameOnDownload($dms_id);
|
||||
|
||||
|
||||
// Get file to be downloaded from DMS
|
||||
$download = $this->dmslib->download($dms_id, $filename);
|
||||
if (isError($download)) return $download;
|
||||
@@ -323,7 +323,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');
|
||||
@@ -364,24 +369,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,10 +178,10 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
{
|
||||
show_error('Wrong parameter');
|
||||
}
|
||||
|
||||
|
||||
// Check if user is entitled to read dms doc
|
||||
$this->_checkIfEntitledToReadDMSDoc($dms_id);
|
||||
|
||||
|
||||
// Set filename to be used on downlaod
|
||||
$filename = $this->anrechnunglib->setFilenameOnDownload($dms_id);
|
||||
|
||||
@@ -192,18 +192,18 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
// Download file
|
||||
$this->outputFile(getData($download));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
@@ -211,15 +211,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');
|
||||
@@ -229,10 +229,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
|
||||
@@ -243,36 +243,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,
|
||||
@@ -280,7 +285,7 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
'empfehlung' => $empfehlung ? 'positive' : 'negative',
|
||||
'link' => anchor($url, 'Anrechnungsanträge Übersicht')
|
||||
);
|
||||
|
||||
|
||||
sendSanchoMail(
|
||||
'AnrechnungEmpfehlungAbgeben',
|
||||
$body_fields,
|
||||
@@ -288,37 +293,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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,310 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class AdminZeitverfuegbarkeit extends Auth_Controller
|
||||
{
|
||||
const BERECHTIGUNG_ZEITVERFUEGBARKEIT = 'lehre/zeitverfuegbarkeit';
|
||||
private $_uid; // uid of the logged user
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
// Set required permissions
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'lehre/zeitverfuegbarkeit:rw',
|
||||
'saveZeitverfuegbarkeit' => 'lehre/zeitverfuegbarkeit:rw',
|
||||
'deleteZeitverfuegbarkeit' => 'lehre/zeitverfuegbarkeit:rw'
|
||||
)
|
||||
);
|
||||
|
||||
// Load models
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$this->load->model('ressource/Zeitsperre_model', 'ZeitsperreModel');
|
||||
|
||||
// Load libraries
|
||||
$this->load->library('PermissionLib');
|
||||
$this->load->library('AuthLib');
|
||||
$this->load->library('WidgetLib');
|
||||
|
||||
// Load helpers
|
||||
$this->load->helper('array');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'global',
|
||||
'ui',
|
||||
'lehre'
|
||||
)
|
||||
);
|
||||
|
||||
$this->_setAuthUID(); // sets property uid
|
||||
|
||||
$this->setControllerId(); // sets the controller id
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function index()
|
||||
{
|
||||
// Get Studiengaenge the user is entitled for
|
||||
$result = $this->permissionlib->getSTG_isEntitledFor(self::BERECHTIGUNG_ZEITVERFUEGBARKEIT);
|
||||
$studiengang_kz_arr = !isEmptyArray($result) ? $result : array();
|
||||
|
||||
// Get lectors of that Studiengaenge
|
||||
$result = $this->_getLehreinheitmitarbeiterByStg($studiengang_kz_arr);
|
||||
$lektor_arr = hasData($result) ? getData($result) : array();
|
||||
|
||||
// Get available Stundenplan Stunden
|
||||
$result = $this->_getStunden();
|
||||
$stunde_arr = hasData($result) ? getData($result) : array();
|
||||
|
||||
// Get actual Studiensemester to set min-limit Datepicker
|
||||
$result = $this->StudiensemesterModel->getAkt();
|
||||
$studsemStart = hasData($result) ? getData($result)[0]->start : '';
|
||||
|
||||
$view_data = array(
|
||||
'studiengang_kz_arr' => $studiengang_kz_arr,
|
||||
'lektor_arr' => $lektor_arr,
|
||||
'stunde_arr' => $stunde_arr,
|
||||
'studsemStart' => $studsemStart
|
||||
);
|
||||
|
||||
$this->load->view('lehre/lvplanung/adminZeitverfuegbarkeit.php', $view_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save or update Zeitverfuegbarkeit.
|
||||
*/
|
||||
public function saveZeitverfuegbarkeit()
|
||||
{
|
||||
$zeitsperre_id = $this->input->post('zeitsperre_id');
|
||||
$mitarbeiter_uid = $this->input->post('mitarbeiter_uid');
|
||||
$zeitsperretyp_kurzbz = $this->input->post('zeitsperretyp_kurzbz');
|
||||
$bezeichnung = $this->input->post('bezeichnung');
|
||||
$vonDatum = $this->input->post('vondatum');
|
||||
$vonStunde = isEmptyString($this->input->post('vonstunde')) ? null : $this->input->post('vonstunde');
|
||||
$bisDatum = $this->input->post('bisdatum');
|
||||
$bisStunde = isEmptyString($this->input->post('bisstunde')) ? null : $this->input->post('bisstunde');
|
||||
|
||||
$result = $this->_validate($this->input->post());
|
||||
if (isSuccess($result))
|
||||
{
|
||||
if (is_numeric($zeitsperre_id))
|
||||
{
|
||||
$result = $this->ZeitsperreModel->update(
|
||||
$zeitsperre_id,
|
||||
array(
|
||||
'vondatum' => $vonDatum,
|
||||
'vonstunde' => $vonStunde,
|
||||
'bisdatum' => $bisDatum,
|
||||
'bisstunde' => $bisStunde,
|
||||
'bezeichnung' => $bezeichnung
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->ZeitsperreModel->save(
|
||||
$zeitsperretyp_kurzbz,
|
||||
$mitarbeiter_uid,
|
||||
$vonDatum,
|
||||
$bisDatum,
|
||||
$vonStunde,
|
||||
$bisStunde,
|
||||
$bezeichnung
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithJsonError(getError($result));
|
||||
}
|
||||
|
||||
$zeitsperre_id = getData($result);
|
||||
|
||||
// Success response to AJAX
|
||||
$this->outputJsonSuccess(array(
|
||||
'zeitsperre_id' => $zeitsperre_id,
|
||||
'msg' => $this->p->t('ui', 'gespeichert')
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Zeitverfuegbarkeit.
|
||||
*/
|
||||
public function deleteZeitverfuegbarkeit()
|
||||
{
|
||||
$zeitsperre_id = $this->input->post('zeitsperre_id');
|
||||
|
||||
if (!is_numeric($zeitsperre_id))
|
||||
{
|
||||
$this->terminateWithJsonError('Wählen Sie einen Lehrenden aus der Zeitverfügbarkeit-Tabelle aus.');
|
||||
}
|
||||
|
||||
// Load Zeitsperre
|
||||
$result = $this->ZeitsperreModel->load($zeitsperre_id);
|
||||
$delZsp = getData($result)[0];
|
||||
|
||||
// Delete
|
||||
$result = $this->ZeitsperreModel->delete($zeitsperre_id);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithJsonError(getError($result));
|
||||
}
|
||||
|
||||
// Store Deletion query
|
||||
$delQry = $this->db->last_query();
|
||||
|
||||
// Log deletion
|
||||
$this->_logDeletion($delZsp, $delQry);
|
||||
|
||||
$this->outputJsonSuccess(array('msg' => $this->p->t('ui', 'geloescht')));
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* 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');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all lectors that are assigend to Lehreinheiten in actual or future semester.
|
||||
*
|
||||
* @param $studiengang_kz_arr Restrict only to given stg-
|
||||
* @return mixed
|
||||
*/
|
||||
private function _getLehreinheitmitarbeiterByStg($studiengang_kz_arr)
|
||||
{
|
||||
$this->MitarbeiterModel->addSelect('lema.mitarbeiter_uid, nachname, vorname');
|
||||
$this->MitarbeiterModel->addDistinct('lema.mitarbeiter_uid');
|
||||
$this->MitarbeiterModel->addJoin('lehre.tbl_lehreinheitmitarbeiter lema', 'tbl_mitarbeiter.mitarbeiter_uid = lema.mitarbeiter_uid');
|
||||
$this->MitarbeiterModel->addJoin('public.tbl_benutzer b', 'lema.mitarbeiter_uid = b.uid');
|
||||
$this->MitarbeiterModel->addJoin('public.tbl_person p', 'person_id');
|
||||
$this->MitarbeiterModel->addJoin('lehre.tbl_lehreinheit le', 'lehreinheit_id');
|
||||
$this->MitarbeiterModel->addJoin('lehre.tbl_lehrveranstaltung lv', 'lehrveranstaltung_id');
|
||||
$this->MitarbeiterModel->addJoin('public.tbl_studiensemester ss', 'studiensemester_kurzbz');
|
||||
$this->MitarbeiterModel->addOrder('lema.mitarbeiter_uid');
|
||||
|
||||
// Return lektoren assigned to actual or future lehreinheiten
|
||||
return $this->MitarbeiterModel->loadWhere('
|
||||
lv.studiengang_kz IN (' . implode(', ', $studiengang_kz_arr) . ')
|
||||
AND b.aktiv
|
||||
AND personalnummer > 0
|
||||
AND NOW() <= ss.ende'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all available Stunden of Stundentabelle.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
private function _getStunden()
|
||||
{
|
||||
$this->load->model('ressource/Stunde_model', 'StundeModel');
|
||||
$this->StundeModel->addOrder('stunde');
|
||||
|
||||
return $this->StundeModel->load();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validaton checks performed on post data.
|
||||
*
|
||||
* @param $post
|
||||
* @return array|stdClass
|
||||
* @throws Exception
|
||||
*/
|
||||
private function _validate($post)
|
||||
{
|
||||
if (isEmptyString($post['mitarbeiter_uid']))
|
||||
{
|
||||
return (error('LektorIn fehlt'));
|
||||
}
|
||||
|
||||
if (isEmptyString($post['bezeichnung']))
|
||||
{
|
||||
return (error('Notiz fehlt'));
|
||||
}
|
||||
|
||||
if (isEmptyString($post['vondatum']))
|
||||
{
|
||||
return error('Startdatum fehlt');
|
||||
}
|
||||
|
||||
if (isEmptyString($post['bisdatum']))
|
||||
{
|
||||
return error('Endedatum fehlt');
|
||||
}
|
||||
|
||||
if (new DateTime($post['bisdatum']) < new DateTime($post['vondatum']))
|
||||
{
|
||||
return error('Endedatum darf nicht VOR dem Startdatum liegen');
|
||||
}
|
||||
|
||||
// Check bisstunde not after vonstunde within same day
|
||||
if (new DateTime($post['bisdatum']) == new DateTime($post['vondatum']))
|
||||
{
|
||||
if (is_numeric($post['vonstunde']) && is_numeric($post['bisstunde'])
|
||||
&& $post['bisstunde'] < $post['vonstunde'])
|
||||
{
|
||||
return error('Am gleichen Tag darf Endstunde nicht VOR der Startstunde liegen');
|
||||
}
|
||||
}
|
||||
|
||||
// Check dates are > then start of actual Studiensemester
|
||||
$result = $this->StudiensemesterModel->getAkt();
|
||||
$studsemStart = hasData($result) ? getData($result)[0]->start : '';
|
||||
|
||||
if (new DateTime($post['vondatum']) < new DateTime($studsemStart) ||
|
||||
new DateTime($post['bisdatum']) < new DateTime($studsemStart))
|
||||
{
|
||||
return error('Start- und Endedatum können nur für das aktuelle oder künftige Studiensemester geplant werden');
|
||||
}
|
||||
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* Log information of deleted Zeitsperre into log table.
|
||||
*
|
||||
* @param $delZsp object of deleted Zeitsperre
|
||||
* @param $delQry string of performed delete query
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
private function _logDeletion($delZsp, $delQry)
|
||||
{
|
||||
$beschreibung = 'Zeitverfügbarkeitlöschung '
|
||||
. $delZsp->mitarbeiter_uid. ' '
|
||||
. (new DateTime($delZsp->vondatum))->format('d.m.Y')
|
||||
. (is_null($delZsp->vonstunde) ? '(*)' : '('. $delZsp->vonstunde. ')')
|
||||
. '-'
|
||||
. (new DateTime($delZsp->bisdatum))->format('d.m.Y')
|
||||
. (is_null($delZsp->bisstunde) ? '(*)' : '('. $delZsp->bisstunde. ')')
|
||||
. '';
|
||||
|
||||
$this->load->model('system/Log_model', 'LogModel');
|
||||
return $this->LogModel->insert(array(
|
||||
'mitarbeiter_uid' => $this->_uid,
|
||||
'beschreibung' => substr($beschreibung, 0, 64),
|
||||
'sql' => $delQry
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -18,10 +18,10 @@ class Variables extends Auth_Controller
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'setVar' => 'basis/variable:rw',
|
||||
'getVar' => 'basis/variable:rw',
|
||||
'changeStudiensemesterVar' => 'basis/variable:rw',
|
||||
'changeStudengangsTypVar' => 'basis/variable:rw'
|
||||
'setVar' => array('basis/variable:rw','basis/variable_persoenlich:rw'),
|
||||
'getVar' => array('basis/variable:rw','basis/variable_persoenlich:rw'),
|
||||
'changeStudiensemesterVar' => array('basis/variable:rw','basis/variable_persoenlich:rw'),
|
||||
'changeStudengangsTypVar' => array('basis/variable:rw','basis/variable_persoenlich:rw')
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -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',
|
||||
@@ -123,9 +125,9 @@ class InfoCenter extends Auth_Controller
|
||||
'zgvStatusUpdate' => 'lehre/zgvpruefung:rw',
|
||||
'saveAbsage' => 'infocenter:rw',
|
||||
'saveFreigabe' => 'infocenter:rw',
|
||||
'getNotiz' => 'infocenter:r',
|
||||
'getNotiz' => array('infocenter:r', 'lehre/zgvpruefung:r'),
|
||||
'saveNotiz' => array('infocenter:rw', 'lehre/zgvpruefung:rw'),
|
||||
'updateNotiz' => 'infocenter:rw',
|
||||
'updateNotiz' => array('infocenter:rw', 'lehre/zgvpruefung:rw'),
|
||||
'reloadZgvPruefungen' => 'infocenter:r',
|
||||
'reloadMessages' => 'infocenter:r',
|
||||
'reloadDoks' => 'infocenter:r',
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -548,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')
|
||||
);
|
||||
|
||||
@@ -645,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);
|
||||
@@ -676,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
|
||||
@@ -702,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');
|
||||
}
|
||||
@@ -921,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1199,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');
|
||||
}
|
||||
@@ -1422,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(
|
||||
@@ -1466,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
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -1491,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))
|
||||
@@ -1528,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))
|
||||
{
|
||||
@@ -1586,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
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1656,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);
|
||||
|
||||
@@ -4,6 +4,8 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class ZGVUeberpruefung extends Auth_Controller
|
||||
{
|
||||
const BERECHTIGUNG_KURZBZ = 'lehre/zgvpruefung';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@@ -12,14 +14,15 @@ class ZGVUeberpruefung extends Auth_Controller
|
||||
// Set required permissions
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'lehre/zgvpruefung:r',
|
||||
'getZgvStatusByPrestudent' => 'lehre/zgvpruefung:r'
|
||||
'index' => self::BERECHTIGUNG_KURZBZ.':r',
|
||||
'getZgvStatusByPrestudent' => self::BERECHTIGUNG_KURZBZ.':r'
|
||||
)
|
||||
);
|
||||
$this->load->model('crm/ZGVPruefungStatus_model', 'ZGVPruefungStatusModel');
|
||||
$this->load->model('crm/ZGVPruefung_model', 'ZGVPruefungModel');
|
||||
|
||||
$this->load->library('WidgetLib');
|
||||
$this->load->library('PermissionLib');
|
||||
|
||||
$this->setControllerId();
|
||||
$this->loadPhrases(
|
||||
@@ -31,7 +34,14 @@ class ZGVUeberpruefung extends Auth_Controller
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('system/infocenter/infocenterZgvUeberpruefung.php');
|
||||
$oeKurzbz = $this->permissionlib->getOE_isEntitledFor(self::BERECHTIGUNG_KURZBZ);
|
||||
|
||||
if (!$oeKurzbz)
|
||||
show_error('Keine Berechtigung.');
|
||||
|
||||
$data['oeKurz'] = $oeKurzbz;
|
||||
|
||||
$this->load->view('system/infocenter/infocenterZgvUeberpruefung.php', $data);
|
||||
}
|
||||
|
||||
public function getZgvStatusByPrestudent()
|
||||
|
||||
@@ -58,21 +58,42 @@ class Issues extends Auth_Controller
|
||||
{
|
||||
$issue_ids = $this->input->post('issue_ids');
|
||||
$status_kurzbz = $this->input->post('status_kurzbz');
|
||||
$verarbeitetvon = $this->_uid;
|
||||
$user = $this->_uid;
|
||||
|
||||
$errors = array();
|
||||
foreach ($issue_ids as $issue_id)
|
||||
{
|
||||
$issueRes = $this->issueslib->changeIssueStatus($issue_id, $status_kurzbz, $verarbeitetvon);
|
||||
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 (isError($issueRes))
|
||||
$errors[] = getError($issueRes);
|
||||
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 erfolgreich aktualisiert");
|
||||
$this->outputJsonSuccess("Status successfully refreshed");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -133,7 +154,7 @@ class Issues extends Auth_Controller
|
||||
|
||||
// add oes for which there is the "manage issues" Berechtigung
|
||||
if (!$oe_kurzbz_berechtigt = $this->permissionlib->getOE_isEntitledFor(self::BERECHTIGUNG_KURZBZ))
|
||||
show_error('Keine Berechtigung oder Fehler bei Berechtigungsprüfung');
|
||||
show_error('No permission or error when checking permissions');
|
||||
|
||||
$all_oe_kurzbz_berechtigt = array_unique(array_merge($oe_kurzbz_for_funktion, $oe_kurzbz_berechtigt));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user