mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-24 23:49:28 +00:00
merge master into feature-3379/rt_uebersicht_zeigt_abgewiesene_an
This commit is contained in:
@@ -71,6 +71,16 @@ $config['navigation_header'] = array(
|
||||
'lehre/lehrauftrag_erteilen:r'
|
||||
)
|
||||
),
|
||||
'zverfueg' => array(
|
||||
'link' => site_url('lehre/lvplanung/AdminZeitverfuegbarkeit'),
|
||||
'description' => 'Zeitverfügbarkeit',
|
||||
'expand' => true,
|
||||
'sort' => 45,
|
||||
'requiredPermissions' => array(
|
||||
'lehre/zeitverfuegbarkeit:rw',
|
||||
'lehre/zeitverfuegbarkeit:rw'
|
||||
)
|
||||
),
|
||||
'zgvueberpruefung' => array(
|
||||
'link' => site_url('system/infocenter/ZGVUeberpruefung'),
|
||||
'description' => 'ZGV Überprüfung',
|
||||
@@ -235,3 +245,14 @@ $config['navigation_menu']['lehre/lehrauftrag/LehrauftragErteilen/*'] = array(
|
||||
'requiredPermissions' => array('lehre/lehrauftrag_erteilen:r')
|
||||
)
|
||||
);
|
||||
|
||||
$config['navigation_menu']['system/issues/Issues/*'] = array(
|
||||
'fehlerzustaendigkeiten' => array(
|
||||
'link' => site_url('system/issues/IssuesZustaendigkeiten'),
|
||||
'description' => 'Fehler Zuständigkeiten',
|
||||
'icon' => 'cogs',
|
||||
'sort' => 100,
|
||||
'target' => '_blank',
|
||||
'requiredPermissions' => array('admin:rw')
|
||||
)
|
||||
);
|
||||
|
||||
@@ -16,9 +16,11 @@ if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
class AnrechnungJob extends JOB_Controller
|
||||
{
|
||||
const APPROVE_ANRECHNUNG_URI = '/lehre/anrechnung/ApproveAnrechnungUebersicht';
|
||||
const REVIEW_ANRECHNUNG_URI = '/lehre/anrechnung/ReviewAnrechnungUebersicht';
|
||||
|
||||
const ANRECHNUNGSTATUS_APPROVED = 'approved';
|
||||
const ANRECHNUNGSTATUS_REJECTED = 'rejected';
|
||||
const ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR = 'inProgressLektor';
|
||||
const ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_STGL = 'AnrechnungNotizSTGL';
|
||||
|
||||
/**
|
||||
@@ -33,6 +35,8 @@ class AnrechnungJob extends JOB_Controller
|
||||
|
||||
$this->load->helper('url');
|
||||
$this->load->helper('hlp_sancho_helper');
|
||||
|
||||
$this->load->library('AnrechnungLib');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -188,7 +192,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 +203,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.');
|
||||
@@ -339,18 +346,97 @@ html;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Send Sancho mail to remind lecturers to provide their recommendation if not done until one week after request.
|
||||
*/
|
||||
public function sendMailRemindRecommendation(){
|
||||
|
||||
$this->logInfo('Start AnrechnungJob sendMailRemindRecommendation to remind lecturers to provide their recommendation.');
|
||||
|
||||
// Get Anrechnungen with pending recommendations, that were requested 1 week before today.
|
||||
// Restrict query for Anrechnungen of actual semester.
|
||||
$this->AnrechnungModel->addSelect('astat.anrechnung_id, astat.datum, astat.insertamum');
|
||||
$this->AnrechnungModel->addDistinct('astat.anrechnung_id');
|
||||
$this->AnrechnungModel->addJoin('lehre.tbl_anrechnung_anrechnungstatus astat', 'anrechnung_id');
|
||||
|
||||
$result = $this->AnrechnungModel->loadWhere('
|
||||
studiensemester_kurzbz = (
|
||||
SELECT studiensemester_kurzbz FROM tbl_studiensemester WHERE now()::date BETWEEN start AND ende)
|
||||
)
|
||||
AND genehmigt_von IS NULL
|
||||
AND empfehlung_anrechnung IS NULL
|
||||
AND status_kurzbz = '. $this->db->escape(self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR) .' -- in Bearbeitung durch Lektor
|
||||
AND NOW()::date = (astat.datum + interval \'1 week\') -- eine Woche nach Empfehlungsanfrage
|
||||
ORDER BY astat.anrechnung_id, astat.datum DESC, astat.insertamum DESC -- nur letzten status dabei prüfen
|
||||
');
|
||||
|
||||
// Exit if there are no pending recommendations
|
||||
if (!hasData($result))
|
||||
{
|
||||
$this->logInfo('End AnrechnungJob sendMailRemindRecommendation, because no recommendations to be done.');
|
||||
exit;
|
||||
}
|
||||
|
||||
$anrechnung_id_arr = array_column(getData($result), 'anrechnung_id');
|
||||
|
||||
$arr_lvLector_arr = array();
|
||||
foreach ($anrechnung_id_arr as $anrechnung_id)
|
||||
{
|
||||
$arr_lvLector_arr[]= $this->anrechnunglib->getLectors($anrechnung_id); // Returns LV Leitung. If not present, then all lectors of LV.
|
||||
}
|
||||
|
||||
// Unique lector array to send only one mail per lector
|
||||
$arr_lvLector_arr = array_unique($arr_lvLector_arr, SORT_REGULAR);
|
||||
|
||||
// Link to 'Anrechnungen prüfen' dashboard
|
||||
$url =
|
||||
CIS_ROOT. 'cis/index.php?menu='.
|
||||
CIS_ROOT. 'cis/menu.php?content_id=&content='.
|
||||
CIS_ROOT. index_page(). self::REVIEW_ANRECHNUNG_URI;
|
||||
|
||||
foreach ($arr_lvLector_arr as $lvLector_arr)
|
||||
{
|
||||
foreach ($lvLector_arr as $lector)
|
||||
{
|
||||
// Prepare mail content
|
||||
$fields = array(
|
||||
'vorname' => $lector->vorname,
|
||||
'stgl_name' => 'Die Studiengangsleitung',
|
||||
'link' => anchor($url, 'Anrechnungsanträge Übersicht')
|
||||
);
|
||||
|
||||
// Send mail
|
||||
sendSanchoMail(
|
||||
'AnrechnungEmpfehlungAnfordern',
|
||||
$fields,
|
||||
$lector->uid. '@'. DOMAIN,
|
||||
'Erinnerung: Deine Empfehlung wird benötigt zur Anerkennung nachgewiesener Kenntnisse'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$this->logInfo('SUCCEDED AnrechnungJob sendMailRemindRecommendation');
|
||||
|
||||
}
|
||||
|
||||
// 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,315 @@ 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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,7 +359,7 @@ class LehrauftragJob extends JOB_Controller
|
||||
for ($i = 0; $i < $data_len; $i++)
|
||||
{
|
||||
// Get all users entitled by organisational unit
|
||||
$result = $this->BenutzerrolleModel->getBenutzerByBerechtigung(self::BERECHTIGUNG_LEHRAUFTRAG_ERTEILEN, $data[$i]['oe_kurzbz']);
|
||||
$result = $this->BenutzerrolleModel->getBenutzerByBerechtigung(self::BERECHTIGUNG_LEHRAUFTRAG_ERTEILEN, $data[$i]['oe_kurzbz'], 'suid');
|
||||
|
||||
if ($berechtigung_arr = getData($result))
|
||||
{
|
||||
|
||||
@@ -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,13 +390,17 @@ 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);
|
||||
|
||||
// Get file to be downloaded from DMS
|
||||
$download = $this->dmslib->download($dms_id, $filename);
|
||||
if (isError($download)) return $download;
|
||||
|
||||
// Download file
|
||||
$this->dmslib->download($dms_id, $filename);
|
||||
$this->outputFile(getData($download));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -412,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');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -457,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,22 +107,30 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
{
|
||||
return $this->outputJsonError('Fehler beim Übertragen der Daten.');
|
||||
}
|
||||
|
||||
|
||||
$json = array(
|
||||
'status_kurzbz' => self::ANRECHNUNGSTATUS_APPROVED,
|
||||
'status_bezeichnung' => $this->anrechnunglib->getStatusbezeichnung(self::ANRECHNUNGSTATUS_APPROVED),
|
||||
'prestudenten' => []
|
||||
);
|
||||
|
||||
// Approve Anrechnung
|
||||
foreach ($data as $item)
|
||||
{
|
||||
if ($this->anrechnunglib->approveAnrechnung($item['anrechnung_id']))
|
||||
// Get Prestudent
|
||||
$this->AnrechnungModel->addSelect('prestudent_id');
|
||||
$result = $this->AnrechnungModel->load($item['anrechnung_id']);
|
||||
$prestudent_id = getData($result)[0]->prestudent_id;
|
||||
|
||||
// Approve
|
||||
if ($this->anrechnunglib->approveAnrechnung($item['anrechnung_id']))
|
||||
{
|
||||
$json[]= array(
|
||||
'anrechnung_id' => $item['anrechnung_id'],
|
||||
'status_kurzbz' => self::ANRECHNUNGSTATUS_APPROVED,
|
||||
'status_bezeichnung' => $this->anrechnunglib->getStatusbezeichnung(self::ANRECHNUNGSTATUS_APPROVED)
|
||||
);
|
||||
$json['prestudenten'][$prestudent_id][] = $item['anrechnung_id'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Output json to ajax
|
||||
if (isset($json) && !isEmptyArray($json))
|
||||
if (isset($json) && !isEmptyArray($json['prestudenten']))
|
||||
{
|
||||
return $this->outputJsonSuccess($json);
|
||||
}
|
||||
@@ -121,20 +139,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 +165,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Output json to ajax
|
||||
if (isset($json) && !isEmptyArray($json))
|
||||
{
|
||||
@@ -158,22 +176,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 +199,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
{
|
||||
// Count up LV with no lector
|
||||
$counter++;
|
||||
|
||||
|
||||
// Continue loop, if LV has no lector
|
||||
continue;
|
||||
}
|
||||
@@ -195,7 +213,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 +224,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,16 +234,16 @@ 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);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Download and open uploaded document (Nachweisdokument).
|
||||
*/
|
||||
@@ -239,26 +257,29 @@ 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);
|
||||
|
||||
|
||||
// Get file to be downloaded from DMS
|
||||
$download = $this->dmslib->download($dms_id, $filename);
|
||||
if (isError($download)) return $download;
|
||||
|
||||
// Download file
|
||||
$this->dmslib->download($dms_id, $filename);
|
||||
$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
|
||||
@@ -266,36 +287,30 @@ class approveAnrechnungUebersicht 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->loadWhere(array(
|
||||
'lehrveranstaltung_id' => $result->lehrveranstaltung_id
|
||||
));
|
||||
|
||||
|
||||
|
||||
if(!$result = getData($result)[0])
|
||||
{
|
||||
show_error('Failed loading Lehrveranstaltung');
|
||||
}
|
||||
|
||||
// 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');
|
||||
|
||||
$studiengang_kz = $result->studiengang_kz;
|
||||
|
||||
// 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
|
||||
@@ -305,7 +320,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
{
|
||||
// Get Lehrveranstaltungen
|
||||
$anrechnung_arr = array();
|
||||
|
||||
|
||||
foreach ($mail_params as $item)
|
||||
{
|
||||
$this->AnrechnungModel->addSelect('lehrveranstaltung_id, studiensemester_kurzbz');
|
||||
@@ -314,10 +329,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.
|
||||
@@ -329,27 +344,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,
|
||||
@@ -359,7 +374,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.
|
||||
@@ -369,33 +384,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.
|
||||
@@ -405,10 +421,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) ||
|
||||
@@ -205,9 +205,14 @@ class requestAnrechnung extends Auth_Controller
|
||||
}
|
||||
|
||||
// Check if user is entitled to read dms doc
|
||||
self::_checkIfEntitledToReadDMSDoc($dms_id);
|
||||
$this->_checkIfEntitledToReadDMSDoc($dms_id);
|
||||
|
||||
$this->dmslib->download($dms_id);
|
||||
// Get file to be downloaded from DMS
|
||||
$download = $this->dmslib->download($dms_id, $filename);
|
||||
if (isError($download)) return $download;
|
||||
|
||||
// Download file
|
||||
$this->outputFile(getData($download));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -226,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');
|
||||
|
||||
@@ -253,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);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -324,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
|
||||
@@ -366,4 +371,4 @@ class requestAnrechnung extends Auth_Controller
|
||||
// Upload document
|
||||
return $this->dmslib->upload($dms, 'uploadfile', array('pdf'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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])
|
||||
{
|
||||
@@ -217,15 +217,18 @@ class reviewAnrechnungDetail 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);
|
||||
|
||||
// Download file
|
||||
$this->dmslib->download($dms_id, $filename);
|
||||
}
|
||||
|
||||
// Get file to be downloaded from DMS
|
||||
$download = $this->dmslib->download($dms_id, $filename);
|
||||
if (isError($download)) return $download;
|
||||
|
||||
// Download file
|
||||
$this->outputFile(getData($download));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the UID of the logged user and checks if it is valid
|
||||
@@ -320,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');
|
||||
@@ -361,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,28 +178,32 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
{
|
||||
show_error('Wrong parameter');
|
||||
}
|
||||
|
||||
|
||||
// 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);
|
||||
|
||||
|
||||
// Get file to be downloaded from DMS
|
||||
$download = $this->dmslib->download($dms_id, $filename);
|
||||
if (isError($download)) return $download;
|
||||
|
||||
// Download file
|
||||
$this->dmslib->download($dms_id, $filename);
|
||||
$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
|
||||
@@ -207,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');
|
||||
@@ -225,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
|
||||
@@ -239,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,
|
||||
@@ -276,7 +285,7 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
'empfehlung' => $empfehlung ? 'positive' : 'negative',
|
||||
'link' => anchor($url, 'Anrechnungsanträge Übersicht')
|
||||
);
|
||||
|
||||
|
||||
sendSanchoMail(
|
||||
'AnrechnungEmpfehlungAbgeben',
|
||||
$body_fields,
|
||||
@@ -284,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()
|
||||
|
||||
@@ -6,7 +6,7 @@ class Issues extends Auth_Controller
|
||||
{
|
||||
private $_uid;
|
||||
|
||||
const FUNKTION_KURZBZ = 'ass'; // // user having this funktion can see issues for oes assigned with this funktion
|
||||
const FUNKTION_KURZBZ = 'ass'; // user having this funktion can see issues for oes assigned with this funktion
|
||||
const BERECHTIGUNG_KURZBZ = 'system/issues_verwalten'; // user having this permission can see issues for oes assigned with this permission
|
||||
|
||||
public function __construct()
|
||||
@@ -39,6 +39,7 @@ class Issues extends Auth_Controller
|
||||
);
|
||||
|
||||
$this->_setAuthUID(); // sets property uid
|
||||
$this->setControllerId(); // sets the controller id
|
||||
}
|
||||
|
||||
public function index()
|
||||
@@ -58,21 +59,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");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,7 +128,7 @@ class Issues extends Auth_Controller
|
||||
{
|
||||
$all_funktionen_oe_kurzbz[$benutzerfunktion->oe_kurzbz][] = $benutzerfunktion->funktion_kurzbz;
|
||||
|
||||
// separate oes for the funktion needed for displaying issues
|
||||
// separate oes for the additional funktion which enables displaying issues
|
||||
if ($benutzerfunktion->funktion_kurzbz == self::FUNKTION_KURZBZ)
|
||||
{
|
||||
$oe_kurzbz_for_funktion[] = $benutzerfunktion->oe_kurzbz;
|
||||
@@ -132,8 +154,10 @@ 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');
|
||||
$oe_kurzbz_berechtigt = $this->permissionlib->getOE_isEntitledFor(self::BERECHTIGUNG_KURZBZ);
|
||||
|
||||
if (!$oe_kurzbz_berechtigt)
|
||||
show_error('No permission or error when checking permissions');
|
||||
|
||||
$all_oe_kurzbz_berechtigt = array_unique(array_merge($oe_kurzbz_for_funktion, $oe_kurzbz_berechtigt));
|
||||
|
||||
|
||||
@@ -0,0 +1,217 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class IssuesZustaendigkeiten extends Auth_Controller
|
||||
{
|
||||
private $_uid;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'admin:r',
|
||||
'getApps' => 'admin:r',
|
||||
'getFehlercodes' => 'admin:r',
|
||||
'getNonAssignedZustaendigkeiten' => 'admin:r',
|
||||
'addZustaendigkeit' => 'admin:rw',
|
||||
'deleteZustaendigkeit' => 'admin:rw'
|
||||
)
|
||||
);
|
||||
|
||||
// Load libraries
|
||||
$this->load->library('IssuesLib');
|
||||
$this->load->library('WidgetLib');
|
||||
|
||||
// Load models
|
||||
$this->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
|
||||
$this->load->model('system/Fehler_model', 'FehlerModel');
|
||||
$this->load->model('system/Fehler_model', 'FehlerModel');
|
||||
$this->load->model('system/Fehlerzustaendigkeiten_model', 'FehlerzustaendigkeitenModel');
|
||||
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'global',
|
||||
'ui',
|
||||
'filter',
|
||||
'lehre',
|
||||
'person',
|
||||
'fehlermonitoring'
|
||||
)
|
||||
);
|
||||
|
||||
$this->_setAuthUID(); // sets property uid
|
||||
$this->setControllerId(); // sets the controller id
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->load->view("system/issues/issuesZustaendigkeiten.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads all Apps to which Fehler exist.
|
||||
*/
|
||||
public function getApps()
|
||||
{
|
||||
$this->FehlerModel->addDistinct();
|
||||
$this->FehlerModel->addSelect('app');
|
||||
$this->FehlerModel->addOrder('app');
|
||||
|
||||
$appRes = $this->FehlerModel->load();
|
||||
|
||||
$this->outputJson($appRes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all fehlercodes, optionally by app.
|
||||
*/
|
||||
public function getFehlercodes()
|
||||
{
|
||||
$app = $this->input->get('app');
|
||||
|
||||
//$this->FehlerModel->addSelect('fehlercode, fehler_kurzbz, fehlertext, fehlertyp_kurzbz');
|
||||
$this->FehlerModel->addOrder('fehlercode');
|
||||
|
||||
$fehlerRes = isset($app) ? $this->FehlerModel->loadWhere(array('app' => $app)) : $this->FehlerModel->load();
|
||||
|
||||
$this->outputJson($fehlerRes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all Mitarbeiter, Organisationseinheiten, Funktionen not assigned to a Fehler yet.
|
||||
*/
|
||||
public function getNonAssignedZustaendigkeiten()
|
||||
{
|
||||
$fehlercode = $this->input->get('fehlercode');
|
||||
|
||||
$mitarbeiterRes = $this->FehlerzustaendigkeitenModel->getNonAssignedMitarbeiter($fehlercode);
|
||||
|
||||
if (isError($mitarbeiterRes))
|
||||
{
|
||||
$this->outputJsonError(getError($mitarbeiterRes));
|
||||
return;
|
||||
}
|
||||
|
||||
$this->OrganisationseinheitModel->addSelect('oe_kurzbz, bezeichnung, organisationseinheittyp_kurzbz');
|
||||
$this->OrganisationseinheitModel->addOrder('organisationseinheittyp_kurzbz, bezeichnung');
|
||||
$oeRes = $this->OrganisationseinheitModel->loadWhere(array('aktiv' => true));
|
||||
|
||||
if (isError($oeRes))
|
||||
{
|
||||
$this->outputJsonError(getError($oeRes));
|
||||
return;
|
||||
}
|
||||
|
||||
$oe_funktionen = array();
|
||||
|
||||
if (hasData($oeRes))
|
||||
{
|
||||
$oes = getData($oeRes);
|
||||
|
||||
foreach ($oes as $oe)
|
||||
{
|
||||
$oe->funktionen = array();
|
||||
$funktionRes = $this->FehlerzustaendigkeitenModel->getNonAssignedFunktionen($fehlercode, $oe->oe_kurzbz);
|
||||
|
||||
if (isError($funktionRes))
|
||||
{
|
||||
$this->outputJsonError(getError($oeRes));
|
||||
return;
|
||||
}
|
||||
|
||||
$funktionData = getData($funktionRes);
|
||||
$oe->funktionen = $funktionData;
|
||||
$oe_funktionen[] = $oe;
|
||||
}
|
||||
}
|
||||
|
||||
if (isError($funktionRes))
|
||||
{
|
||||
$this->outputJsonError(getError($funktionRes));
|
||||
return;
|
||||
}
|
||||
|
||||
$result = array(
|
||||
'mitarbeiter' => getData($mitarbeiterRes),
|
||||
'oe_funktionen' => $oe_funktionen
|
||||
);
|
||||
|
||||
$this->outputJsonSuccess($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a Zuständigkeit after performing error checks.
|
||||
*/
|
||||
public function addZustaendigkeit()
|
||||
{
|
||||
$fehlercode = $this->input->post('fehlercode');
|
||||
$mitarbeiter_person_id = $this->input->post('mitarbeiter_person_id');
|
||||
$oe_kurzbz = $this->input->post('oe_kurzbz');
|
||||
$funktion_kurzbz = $this->input->post('funktion_kurzbz');
|
||||
|
||||
if (isEmptyString($fehlercode))
|
||||
$this->outputJsonError($this->p->t('fehlermonitoring', 'fehlercodeFehlt'));
|
||||
elseif (isEmptyString($mitarbeiter_person_id) && isEmptyString($oe_kurzbz))
|
||||
$this->outputJsonError($this->p->t('fehlermonitoring', 'mitarbeiterUndOeFehlt'));
|
||||
elseif (!isEmptyString($mitarbeiter_person_id) && !isEmptyString($oe_kurzbz))
|
||||
$this->outputJsonError($this->p->t('fehlermonitoring', 'nurOeOderMitarbeiterSetzen'));
|
||||
elseif (isset($mitarbeiter_person_id) && !is_numeric($mitarbeiter_person_id))
|
||||
$this->outputJsonError($this->p->t('fehlermonitoring', 'ungueltigeMitarbeiterId'));
|
||||
else
|
||||
{
|
||||
$data = array(
|
||||
'fehlercode' => $fehlercode
|
||||
);
|
||||
|
||||
if (!isEmptyString($mitarbeiter_person_id))
|
||||
$data['person_id'] = $mitarbeiter_person_id;
|
||||
|
||||
if (!isEmptyString($oe_kurzbz))
|
||||
$data['oe_kurzbz'] = $oe_kurzbz;
|
||||
|
||||
if (!isEmptyString($funktion_kurzbz))
|
||||
$data['funktion_kurzbz'] = $funktion_kurzbz;
|
||||
|
||||
$zustaendigkeitExistsRes = $this->FehlerzustaendigkeitenModel->loadWhere($data);
|
||||
|
||||
if (isError($zustaendigkeitExistsRes))
|
||||
$this->outputJsonError(getError($zustaendigkeitExistsRes));
|
||||
elseif (hasData($zustaendigkeitExistsRes))
|
||||
$this->outputJsonError($this->p->t('fehlermonitoring', 'zustaendigkeitExistiert'));
|
||||
else
|
||||
{
|
||||
$data['insertvon'] = $this->_uid;
|
||||
|
||||
$this->outputJson($this->FehlerzustaendigkeitenModel->insert($data));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Zuständigkeit.
|
||||
*/
|
||||
public function deleteZustaendigkeit()
|
||||
{
|
||||
$fehlerzustaendigkeiten_id = $this->input->post('fehlerzustaendigkeiten_id');
|
||||
|
||||
// check if Id correctly passed
|
||||
if (!isset($fehlerzustaendigkeiten_id) || !is_numeric($fehlerzustaendigkeiten_id))
|
||||
{
|
||||
$this->outputJsonError($this->p->t('fehlermonitoring', 'ungueltigeZustaendigkeitenId'));
|
||||
return;
|
||||
}
|
||||
|
||||
$this->outputJson($this->FehlerzustaendigkeitenModel->delete($fehlerzustaendigkeiten_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the UID of the logged user and checks if it is valid
|
||||
*/
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
if (!$this->_uid) show_error('User authentification failed');
|
||||
}
|
||||
}
|
||||
@@ -22,11 +22,16 @@ class DB_Model extends CI_Model
|
||||
const PGSQL_BOOLEAN_FALSE = 'f';
|
||||
const PGSQL_BOOLEAN_TYPE = 'bool';
|
||||
const PGSQL_BOOLEAN_ARRAY_TYPE = '_bool';
|
||||
const PGSQL_INT2_TYPE = 'int2';
|
||||
const PGSQL_INT4_TYPE = 'int4';
|
||||
const PGSQL_INT8_TYPE = 'int8';
|
||||
const PGSQL_FLOAT4_TYPE = 'float4';
|
||||
const PGSQL_FLOAT8_TYPE = 'float8';
|
||||
|
||||
protected $dbTable; // Name of the DB-Table for CI-Insert, -Update, ...
|
||||
protected $pk; // Name of the PrimaryKey for DB-Update, Load, ...
|
||||
protected $pk; // Name of the PrimaryKey for DB-Update, Load, ...
|
||||
protected $hasSequence; // False if this table has a composite primary key that is not using a sequence
|
||||
// True if this table has a primary key that uses a sequence
|
||||
// True if this table has a primary key that uses a sequence
|
||||
|
||||
private $executedQueryMetaData;
|
||||
private $executedQueryListFields;
|
||||
@@ -271,11 +276,6 @@ class DB_Model extends CI_Model
|
||||
/**
|
||||
* Load data and convert a record into a list of data from the main table,
|
||||
* and linked to every element, the data from the side tables
|
||||
*
|
||||
* TODO:
|
||||
* - Adding support for composed primary key
|
||||
* - Adding support for cascading side tables (useful?)
|
||||
*
|
||||
* NOTE: sub queries are not supported in the from clause
|
||||
*
|
||||
* @return array
|
||||
@@ -598,6 +598,28 @@ class DB_Model extends CI_Model
|
||||
return $val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert PG-Int* to PHP-Integer
|
||||
*/
|
||||
public function pgIntPhp($val)
|
||||
{
|
||||
// If it is null, let it be null
|
||||
if ($val == null) return $val;
|
||||
|
||||
return intval($val);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert PG-Float* to PHP-Float
|
||||
*/
|
||||
public function pgFloatPhp($val)
|
||||
{
|
||||
// If it is null, let it be null
|
||||
if ($val == null) return $val;
|
||||
|
||||
return floatval($val);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts from PostgreSQL array to php array
|
||||
* It also takes care about array of booleans
|
||||
@@ -892,6 +914,11 @@ class DB_Model extends CI_Model
|
||||
// If array type, boolean type OR a UDF
|
||||
if (strpos($eqmd->type, DB_Model::PGSQL_ARRAY_TYPE) !== false
|
||||
|| $eqmd->type == DB_Model::PGSQL_BOOLEAN_TYPE
|
||||
|| $eqmd->type == DB_Model::PGSQL_INT2_TYPE
|
||||
|| $eqmd->type == DB_Model::PGSQL_INT4_TYPE
|
||||
|| $eqmd->type == DB_Model::PGSQL_INT8_TYPE
|
||||
|| $eqmd->type == DB_Model::PGSQL_FLOAT4_TYPE
|
||||
|| $eqmd->type == DB_Model::PGSQL_FLOAT8_TYPE
|
||||
|| $this->udflib->isUDFColumn($eqmd->name, $eqmd->type))
|
||||
{
|
||||
// If UDFs are inside this result set
|
||||
@@ -941,6 +968,19 @@ class DB_Model extends CI_Model
|
||||
{
|
||||
$resultElement->{$toBeConverted->name} = $this->pgBoolPhp($resultElement->{$toBeConverted->name});
|
||||
}
|
||||
// Integer type
|
||||
elseif ($toBeConverted->type == DB_Model::PGSQL_INT2_TYPE
|
||||
|| $toBeConverted->type == DB_Model::PGSQL_INT4_TYPE
|
||||
|| $toBeConverted->type == DB_Model::PGSQL_INT8_TYPE)
|
||||
{
|
||||
$resultElement->{$toBeConverted->name} = $this->pgIntPhp($resultElement->{$toBeConverted->name});
|
||||
}
|
||||
// Float type
|
||||
elseif ($toBeConverted->type == DB_Model::PGSQL_FLOAT4_TYPE
|
||||
|| $toBeConverted->type == DB_Model::PGSQL_FLOAT8_TYPE)
|
||||
{
|
||||
$resultElement->{$toBeConverted->name} = $this->pgFloatPhp($resultElement->{$toBeConverted->name});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ abstract class FHC_Controller extends CI_Controller
|
||||
protected function terminateWithJsonError($message)
|
||||
{
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(error($message));
|
||||
echo json_encode(error($message)); // KEEP IT!!!
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -132,31 +132,41 @@ abstract class FHC_Controller extends CI_Controller
|
||||
{
|
||||
$this->output->set_content_type('application/json')->set_output(json_encode($mixed));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* To download the given file represented by the fileObj parameter.
|
||||
* fileObj has the following structure:
|
||||
* $fileObj->filename
|
||||
* $fileObj->file
|
||||
* $fileObj->name
|
||||
* $fileObj->mimetype
|
||||
* $fileObj->disposition
|
||||
*/
|
||||
protected function outputFile($fileObj)
|
||||
{
|
||||
if (file_exists($fileObj->file))
|
||||
// If the file exists
|
||||
if (isset($fileObj->file) && !isEmptyString($fileObj->file) && file_exists($fileObj->file))
|
||||
{
|
||||
$finfo = new finfo(FILEINFO_MIME);
|
||||
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: '. $finfo->file($fileObj->file));
|
||||
header('Content-Type: '. $fileObj->mimetype);
|
||||
header('Expires: 0');
|
||||
header('Cache-Control: must-revalidate');
|
||||
header('Pragma: public');
|
||||
header('Content-Length: ' . filesize($fileObj->file));
|
||||
|
||||
if (isset($fileObj->disposition) && ($fileObj->disposition == 'inline' || $fileObj->disposition == 'attachment'))
|
||||
|
||||
if (isset($fileObj->disposition)
|
||||
&& ($fileObj->disposition == 'inline' || $fileObj->disposition == 'attachment'))
|
||||
{
|
||||
header('Content-Disposition: '. $fileObj->disposition. '; filename="'. $fileObj->name. '"');
|
||||
}
|
||||
|
||||
readfile($fileObj->file);
|
||||
|
||||
exit;
|
||||
|
||||
readfile($fileObj->file); // reads the file content to the output buffer
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise print an error
|
||||
show_error('The provided file does not exist: '.(isset($fileObj->file) ? $fileObj->file : 'file not given'));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
+249
-60
@@ -3,113 +3,238 @@
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
* Model to work with the filesystem, it represents a directory
|
||||
* It could be extended or could be used directly to work on the given path
|
||||
*/
|
||||
abstract class FS_Model extends CI_Model
|
||||
class FS_Model extends CI_Model
|
||||
{
|
||||
protected $filepath; // Path of the file
|
||||
const READ_MODE = 'r';
|
||||
const READ_WRITE_MODE = 'w+';
|
||||
const READ_APPEND_MODE = 'a+';
|
||||
const BLOCK_SIZE = 8192;
|
||||
const META_URI = 'uri';
|
||||
|
||||
private $_path; // Directory where this model can operate
|
||||
|
||||
/**
|
||||
* Loads FilesystemLib and set properties
|
||||
* Set properties
|
||||
*/
|
||||
public function __construct($filepath = null)
|
||||
public function __construct($path)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Load the filesystem library
|
||||
$this->load->library('FilesystemLib');
|
||||
$this->_path = $path;
|
||||
}
|
||||
|
||||
$this->filepath = $filepath;
|
||||
// ------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Opens a file in read mode and returns its file handle
|
||||
*/
|
||||
public function openRead($filename)
|
||||
{
|
||||
return $this->_open($filename, self::READ_MODE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read data from file system
|
||||
*
|
||||
* @return array
|
||||
* Opens a file in read and write mode and returns its file handle
|
||||
* If the file does not exist then it is created
|
||||
*/
|
||||
public function read($filename)
|
||||
public function openReadWrite($filename)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->filepath)) return error('The given filepath in not valid', EXIT_ERROR);
|
||||
|
||||
// Check method parameters
|
||||
if (is_null($filename)) return error('The given filename is not valid', EXIT_ERROR);
|
||||
|
||||
if (!is_null($data = $this->filesystemlib->read($this->filepath, $filename)))
|
||||
{
|
||||
return success(base64_encode($data));
|
||||
}
|
||||
else
|
||||
{
|
||||
return error('An error occurred while reading a file', EXIT_ERROR);
|
||||
}
|
||||
return $this->_open($filename, self::READ_WRITE_MODE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writing data to file system
|
||||
*
|
||||
* @param string $fileContent File content
|
||||
* @return object
|
||||
* Opens a file in read and append mode and returns its file handle
|
||||
* If the file does not exist then it is created
|
||||
*/
|
||||
public function write($filename, $content)
|
||||
public function openReadAppend($filename)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->filepath)) return error('The given filepath in not valid', EXIT_ERROR);
|
||||
return $this->_open($filename, self::READ_APPEND_MODE);
|
||||
}
|
||||
|
||||
// Check method parameters
|
||||
if (is_null($content)) return error('The given file content is not valid', EXIT_ERROR);
|
||||
if (is_null($filename)) return error('The given filename is not valid', EXIT_ERROR);
|
||||
/**
|
||||
* Closes a file handle
|
||||
*/
|
||||
public function close($fileHandle)
|
||||
{
|
||||
return fclose($fileHandle) === true ? success() : error('Error while closing the file handler');
|
||||
}
|
||||
|
||||
if ($this->filesystemlib->write($this->filepath, $filename, base64_decode($content)) === true)
|
||||
/**
|
||||
* Reads a block of bytes from the given file
|
||||
* Returns a success that contains the block
|
||||
* On failure returns an error
|
||||
*/
|
||||
public function readBlock($fileHandle)
|
||||
{
|
||||
// Reads a block of bytes from the file
|
||||
$block = fread($fileHandle, self::BLOCK_SIZE);
|
||||
|
||||
// If an error occurred
|
||||
if ($block === false)
|
||||
{
|
||||
// Prepare the error message
|
||||
$errorMsg = 'An error occurred while reading a file';
|
||||
|
||||
// Tries to get the file name and to concatenate it to the error message
|
||||
$fileMetaData = stream_get_meta_data($fileHandle);
|
||||
if (isset($fileMetaData[self::META_URI])) $errorMsg .= ': '.$fileMetaData[self::META_URI];
|
||||
|
||||
return error($errorMsg); // returns the error
|
||||
}
|
||||
|
||||
return success($block); // return success if everything was fine
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes/appends (depending on how the file was opened) a content into a file
|
||||
* Returns a success that contains the written number of bytes
|
||||
* On failure returns an error
|
||||
*/
|
||||
public function write($fileHandle, $content)
|
||||
{
|
||||
// Writes the provided content to the file
|
||||
$writeResult = fwrite($fileHandle, $content);
|
||||
|
||||
// If an error occurred
|
||||
if ($writeResult === false)
|
||||
{
|
||||
$errorMsg = 'An error occurred while writing a file';
|
||||
|
||||
// Tries to get the file name and to concatenate it to the error message
|
||||
$fileMetaData = stream_get_meta_data($fileHandle);
|
||||
if (isset($fileMetaData[self::META_URI])) $errorMsg .= ': '.$fileMetaData[self::META_URI];
|
||||
|
||||
return error($errorMsg); // returns the error
|
||||
}
|
||||
|
||||
return success($writeResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a given file
|
||||
*/
|
||||
public function remove($filename)
|
||||
{
|
||||
// Check if the property _path represents a valid directory
|
||||
$checkResult = $this->_checkPath();
|
||||
|
||||
if (isError($checkResult)) return $checkResult; // If not then return the error
|
||||
|
||||
// Check filename
|
||||
if (isEmptyString($filename)) return error('The given filename is not valid');
|
||||
|
||||
// remove file
|
||||
if (unlink($this->_path.DIRECTORY_SEPARATOR.$filename) === true)
|
||||
{
|
||||
return success();
|
||||
}
|
||||
else
|
||||
{
|
||||
return error('An error occurred while writing a file', EXIT_ERROR);
|
||||
return error('An error occurred while removing a file');
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------------------------
|
||||
// Old public methods that work with the base64 encoding, not to be used!
|
||||
|
||||
/**
|
||||
* Append data to a file
|
||||
*
|
||||
* @param array $data File content
|
||||
* @return array
|
||||
* Read data from the given file and encode its content to base64
|
||||
*/
|
||||
public function append($filename, $content)
|
||||
public function readBase64($filename)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->filepath)) return error('The given filepath in not valid', EXIT_ERROR);
|
||||
// Open the file in read mode
|
||||
$openReadResult = $this->openRead($filename);
|
||||
if (isError($openReadResult)) return $openReadResult; // if an error occurred then return it
|
||||
|
||||
// Check method parameters
|
||||
if (is_null($content)) return error('The given file content is not valid', EXIT_ERROR);
|
||||
if (is_null($filename)) return error('The given filename is not valid', EXIT_ERROR);
|
||||
$fileContent = ''; // to store the file content
|
||||
$fileHandle = getData($openReadResult); // get the file handle
|
||||
|
||||
if ($this->filesystemlib->append($this->filepath, $filename, base64_decode($content)) === true)
|
||||
// While the end of the file is not reached and the read does not fail
|
||||
while (!feof($fileHandle) && isSuccess($readBlockResult = $this->readBlock($fileHandle)))
|
||||
{
|
||||
return success();
|
||||
}
|
||||
else
|
||||
{
|
||||
return error('An error occurred while appending to a file', EXIT_ERROR);
|
||||
// Concatenate the content of the file
|
||||
$fileContent .= getData($readBlockResult);
|
||||
}
|
||||
|
||||
// If an error occurred while reading then return it
|
||||
if (isError($readBlockResult)) return $readBlockResult;
|
||||
|
||||
// Close the file handler
|
||||
$closeResult = $this->close($fileHandle);
|
||||
if (isError($closeResult)) return $closeResult; // if it fails then return the error
|
||||
|
||||
// If everything was fine encode the file content into base64 and return it as a success
|
||||
return success(base64_encode($fileContent));
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the given content into the given file. The content is base64 encoded
|
||||
*/
|
||||
public function writeBase64($filename, $content)
|
||||
{
|
||||
// Open the file in read and write mode
|
||||
$openWriteResult = $this->openReadWrite($filename);
|
||||
if (isError($openWriteResult)) return $openWriteResult; // if an error occurred then return it
|
||||
|
||||
$fileHandle = getData($openWriteResult); // get the file handle
|
||||
|
||||
// Writes the given base64 encoded content into to given file
|
||||
$writeResult = $this->write($fileHandle, base64_decode($content));
|
||||
// If an error occurred while writing then return it
|
||||
if (isError($writeResult)) return $writeResult;
|
||||
|
||||
// Close the file handler
|
||||
$closeResult = $this->close($fileHandle);
|
||||
if (isError($closeResult)) return $closeResult; // if it fails then return the error
|
||||
|
||||
// If everything was fine
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends the given content into the given file. The content is base64 encoded
|
||||
*/
|
||||
public function appendBase64($filename, $content)
|
||||
{
|
||||
// Open the file in read and append mode
|
||||
$openWriteResult = $this->openReadAppend($filename);
|
||||
if (isError($openWriteResult)) return $openWriteResult; // if an error occurred then return it
|
||||
|
||||
$fileHandle = getData($openWriteResult); // get the file handle
|
||||
|
||||
// Writes the given base64 encoded content into to given file
|
||||
$writeResult = $this->write($fileHandle, base64_decode($content));
|
||||
// If an error occurred while writing then return it
|
||||
if (isError($writeResult)) return $writeResult;
|
||||
|
||||
// Close the file handler
|
||||
$closeResult = $this->close($fileHandle);
|
||||
if (isError($closeResult)) return $closeResult; // if it fails then return the error
|
||||
|
||||
// If everything was fine
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete data from file system
|
||||
* NOTE: it does not work with the base64 encoding but it has been kept for retro compatibility
|
||||
*
|
||||
* @param string $id Primary Key for DELETE
|
||||
* @return array
|
||||
*/
|
||||
public function remove($filename)
|
||||
public function removeBase64($filename)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->filepath)) return error('The given filepath in not valid', EXIT_ERROR);
|
||||
if (is_null($this->_path)) return error('The given _path in not valid', EXIT_ERROR);
|
||||
|
||||
// Check method parameters
|
||||
if (is_null($filename)) return error('The given filename is not valid', EXIT_ERROR);
|
||||
|
||||
if ($this->filesystemlib->remove($this->filepath, $filename) === true)
|
||||
if (unlink($this->_path.DIRECTORY_SEPARATOR.$filename) === true)
|
||||
{
|
||||
return success();
|
||||
}
|
||||
@@ -121,20 +246,21 @@ abstract class FS_Model extends CI_Model
|
||||
|
||||
/**
|
||||
* Rename a file
|
||||
* NOTE: it does not work with the base64 encoding but it has been kept for retro compatibility
|
||||
*
|
||||
* @param string $id Primary Key for DELETE
|
||||
* @return array
|
||||
*/
|
||||
public function rename($filename, $newFilename)
|
||||
public function renameBase64($filename, $newFilename)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->filepath)) return error('The given filepath in not valid', EXIT_ERROR);
|
||||
if (is_null($this->_path)) return error('The given _path in not valid', EXIT_ERROR);
|
||||
|
||||
// Check method parameters
|
||||
if (is_null($filename)) return error('The given filename is not valid', EXIT_ERROR);
|
||||
if (is_null($newFilename)) return error('The given new filename is not valid', EXIT_ERROR);
|
||||
|
||||
if ($this->filesystemlib->rename($this->filepath, $filename, $this->filepath, $newFilename) === true)
|
||||
if (rename($this->_path.DIRECTORY_SEPARATOR.$filename, $this->_path.DIRECTORY_SEPARATOR.$newFilename) === true)
|
||||
{
|
||||
return success();
|
||||
}
|
||||
@@ -143,4 +269,67 @@ abstract class FS_Model extends CI_Model
|
||||
return error('An error occurred while renaming a file', EXIT_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Checks if the given $this->_path is a valid directory
|
||||
*/
|
||||
private function _checkPath()
|
||||
{
|
||||
// If _path...
|
||||
if (!isEmptyString($this->_path) // ...is a not empty string...
|
||||
&& file_exists($this->_path) && is_dir($this->_path)) // ...exists on the file system and it is a directory...
|
||||
{
|
||||
return success(); // return a success
|
||||
}
|
||||
|
||||
// If not a valid path return an error
|
||||
return error('The given path is not valid: '.$this->_path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Open a file using the provided mode
|
||||
* It returns a file handle
|
||||
* Or write and append if the file does not exist then creates it
|
||||
*/
|
||||
private function _open($filename, $mode)
|
||||
{
|
||||
// Check if the property _path represents a valid directory
|
||||
$checkResult = $this->_checkPath();
|
||||
if (isError($checkResult)) return $checkResult; // If not then return the error
|
||||
|
||||
// Full file path: path + filename
|
||||
$fileFullPath = $this->_path.DIRECTORY_SEPARATOR.$filename;
|
||||
|
||||
// If needed then check if the file exists and really it is a file
|
||||
if ($mode == self::READ_MODE && (!file_exists($fileFullPath) || !is_file($fileFullPath)))
|
||||
{
|
||||
return error('Trying to read a not existing file');
|
||||
}
|
||||
|
||||
// If needed then check if it is possible to read from the path and the file
|
||||
if ($mode == self::READ_MODE && (!is_readable($this->_path) || !is_readable($fileFullPath)))
|
||||
{
|
||||
return error('The given path or filename are not readable: '.$fileFullPath);
|
||||
}
|
||||
|
||||
// If needed then check if the path and the filename are writable
|
||||
if (($mode == self::READ_WRITE_MODE || $mode == self::READ_APPEND_MODE)
|
||||
&& (!is_writable($this->_path) || (file_exists($fileFullPath) && !is_writable($fileFullPath))))
|
||||
{
|
||||
return error('The given path or filename are not writable: '.$fileFullPath);
|
||||
}
|
||||
|
||||
// Open the file in read mode
|
||||
$fileHandle = fopen($fileFullPath, $mode);
|
||||
|
||||
// If it was a failure the return the error
|
||||
if ($fileHandle === false) return error('An error occurred while opening a file in '.$mode.' mode');
|
||||
|
||||
// Otherwise return the file handle
|
||||
return success($fileHandle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Interface defining method to implement for issue resolution checker (from core and extensions)
|
||||
*/
|
||||
interface IIssueResolvedChecker
|
||||
{
|
||||
/**
|
||||
* Checks if a issue of a certain type is resolved.
|
||||
* Classes for resolving a certain issue type implement this method.
|
||||
* @param array $params parameters needed for issue resolution
|
||||
* @return object with success(true) if issue resolved, success(false) otherwise
|
||||
*/
|
||||
public function checkIfIssueIsResolved($params);
|
||||
}
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Controller for retrieving open issues and, if the issue condition is not met anymore, automatically set it to resolved
|
||||
*/
|
||||
abstract class IssueResolver_Controller extends JOB_Controller
|
||||
{
|
||||
const ISSUES_FOLDER = 'issues';
|
||||
const CHECK_ISSUE_RESOLVED_METHOD_NAME = 'checkIfIssueIsResolved';
|
||||
|
||||
protected $_codeLibMappings;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('system/Issue_model', 'IssueModel');
|
||||
|
||||
$this->load->library('IssuesLib');
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes issue resolution.
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$this->logInfo("Issue resolve job started");
|
||||
|
||||
// load open issues with given errorcodes
|
||||
$openIssuesRes = $this->IssueModel->getOpenIssues(array_keys($this->_codeLibMappings));
|
||||
|
||||
// log error if occured
|
||||
if (isError($openIssuesRes))
|
||||
{
|
||||
$this->logError(getError($openIssuesRes));
|
||||
}
|
||||
else
|
||||
{
|
||||
// log info if no data found
|
||||
if (!hasData($openIssuesRes))
|
||||
{
|
||||
$this->logInfo("No open issues found");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$openIssues = getData($openIssuesRes);
|
||||
|
||||
foreach ($openIssues as $issue)
|
||||
{
|
||||
if (isset($this->_codeLibMappings[$issue->fehlercode]))
|
||||
{
|
||||
$libName = $this->_codeLibMappings[$issue->fehlercode];
|
||||
|
||||
// add person id and oe kurzbz automatically as params, merge it with additional params
|
||||
// decode bewerbung_parameter into assoc array
|
||||
$params = array_merge(
|
||||
array('issue_id' => $issue->issue_id, 'issue_person_id' => $issue->person_id, 'issue_oe_kurzbz' => $issue->oe_kurzbz),
|
||||
isset($issue->behebung_parameter) ? json_decode($issue->behebung_parameter, true) : array()
|
||||
);
|
||||
|
||||
// if called from extension (extension name set), path includes extension names, otherwise it is the core library folder
|
||||
$libRootPath = isset($this->_extensionName) ? 'extensions/' . $this->_extensionName . '/' : '';
|
||||
$issuesLibPath = $libRootPath . self::ISSUES_FOLDER . '/';
|
||||
$issuesLibFilePath = DOC_ROOT . 'application/' . $libRootPath . 'libraries/' . self::ISSUES_FOLDER . '/' . $libName . '.php';
|
||||
|
||||
// check if library file exists
|
||||
if (!file_exists($issuesLibFilePath))
|
||||
{
|
||||
// log error and continue with next issue if not
|
||||
$this->logError("Issue library file " . $issuesLibFilePath . " does not exist");
|
||||
continue;
|
||||
}
|
||||
|
||||
// load library connected to fehlercode
|
||||
$this->load->library(
|
||||
$issuesLibPath . $libName
|
||||
);
|
||||
|
||||
$lowercaseLibName = mb_strtolower($libName);
|
||||
|
||||
// check if method is defined in libary class
|
||||
if (!is_callable(array($this->{$lowercaseLibName}, self::CHECK_ISSUE_RESOLVED_METHOD_NAME)))
|
||||
{
|
||||
// log error and continue with next issue if not
|
||||
$this->logError("Method " . self::CHECK_ISSUE_RESOLVED_METHOD_NAME . " is not defined in library $lowercaseLibName");
|
||||
continue;
|
||||
}
|
||||
|
||||
// call the function for checking for issue resolution
|
||||
$issueResolvedRes = $this->{$lowercaseLibName}->{self::CHECK_ISSUE_RESOLVED_METHOD_NAME}($params);
|
||||
|
||||
if (isError($issueResolvedRes))
|
||||
{
|
||||
$this->logError(getError($issueResolvedRes));
|
||||
}
|
||||
else
|
||||
{
|
||||
$issueResolvedData = getData($issueResolvedRes);
|
||||
|
||||
if ($issueResolvedData === true)
|
||||
{
|
||||
// set issue to resolved if needed
|
||||
$behobenRes = $this->issueslib->setBehoben($issue->issue_id, null);
|
||||
|
||||
if (isError($behobenRes))
|
||||
$this->logError(getError($behobenRes));
|
||||
else
|
||||
$this->logInfo("Issue " . $issue->issue_id . " successfully resolved");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->logInfo("Issue resolve job ended");
|
||||
}
|
||||
}
|
||||
@@ -314,32 +314,40 @@ function sanitizeProblemChars($str)
|
||||
$enc = 'UTF-8';
|
||||
|
||||
$acentos = array(
|
||||
'A' => '/À|Á|Â|Ã|Å/',
|
||||
'A' => '/À|Á|Â|Ã|Å|Ă|Ǎ/',
|
||||
'Ae' => '/Ä/',
|
||||
'a' => '/à|á|â|ã|å/',
|
||||
'ae'=> '/ä/',
|
||||
'C' => '/Ç/',
|
||||
'c' => '/ç/',
|
||||
'a' => '/à|á|â|ã|å|ă|ǎ/',
|
||||
'ae' => '/ä/',
|
||||
'C' => '/Ç|Č/',
|
||||
'c' => '/ç|č/',
|
||||
'E' => '/È|É|Ê|Ë/',
|
||||
'e' => '/è|é|ê|ë/',
|
||||
'I' => '/Ì|Í|Î|Ï/',
|
||||
'i' => '/ì|í|î|ï/',
|
||||
'N' => '/Ñ/',
|
||||
'I' => '/Ì|Í|Î|Ï|Ǐ/',
|
||||
'i' => '/ì|í|î|ï|ǐ/',
|
||||
'N' => '/Ñ|Ň|ň/',
|
||||
'n' => '/ñ/',
|
||||
'O' => '/Ò|Ó|Ô|Õ/',
|
||||
'O' => '/Ò|Ó|Ô|Õ|Ǒ/',
|
||||
'Oe' => '/Ö/',
|
||||
'o' => '/ò|ó|ô|õ/',
|
||||
'o' => '/ò|ó|ô|õ|ǒ/',
|
||||
'oe' => '/ö/',
|
||||
'U' => '/Ù|Ú|Û/',
|
||||
'R' => '/Ř/',
|
||||
'r' => '/ř/',
|
||||
'S' => '/Š/',
|
||||
's' => '/š/',
|
||||
'T' => '/Ť/',
|
||||
't' => '/ť/',
|
||||
'U' => '/Ù|Ú|Û|Ŭ|Ǔ/',
|
||||
'Ue' => '/Ü/',
|
||||
'u' => '/ù|ú|û/',
|
||||
'u' => '/ù|ú|û|ŭ|ǔ/',
|
||||
'ue' => '/ü/',
|
||||
'Y' => '/Ý/',
|
||||
'y' => '/ý|ÿ/',
|
||||
'Z' => '/Ž/',
|
||||
'z' => '/ž/',
|
||||
'a.' => '/ª/',
|
||||
'o.' => '/º/',
|
||||
'ss' => '/ß/'
|
||||
);
|
||||
|
||||
return preg_replace($acentos, array_keys($acentos), htmlentities($str,ENT_NOQUOTES, $enc));
|
||||
return preg_replace($acentos, array_keys($acentos), htmlentities($str, ENT_NOQUOTES | ENT_HTML5, $enc));
|
||||
}
|
||||
|
||||
@@ -39,6 +39,24 @@ function printPageTitle($title)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Print the meta tag http-equiv refresh having as content the value of the given parameter
|
||||
*/
|
||||
function printRefreshMeta($refresh)
|
||||
{
|
||||
if ($refresh != null)
|
||||
{
|
||||
if (is_numeric($refresh) && $refresh > 0)
|
||||
{
|
||||
echo '<meta http-equiv="refresh" content="'.$refresh.'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
show_error('The provided refresh parameter has to be a number greater then 0');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates tags for the style sheets you want to include, the parameter could by a string or an array of strings
|
||||
*/
|
||||
|
||||
@@ -74,7 +74,7 @@ function sendSanchoMail($vorlage_kurzbz, $vorlage_data, $to, $subject, $headerIm
|
||||
$body = _parseMailContent('Sancho_Mail_Template', $layout);
|
||||
|
||||
// Send mail
|
||||
$ci->maillib->send($from, $to, $subject, $body, $alias = '', $cc, $bcc, $altMessage = '', $bulk = true, $autogenerated = true);
|
||||
return $ci->maillib->send($from, $to, $subject, $body, $alias = '', $cc, $bcc, $altMessage = '', $bulk = true, $autogenerated = true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,268 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-Helper
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2022 fhcomplete.net
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class AkteLib
|
||||
{
|
||||
const AKTE_KATEGORIE_KURZBZ = 'Akte'; // kategorie_kurzbz of dms when inserting for akte
|
||||
|
||||
private $_ci; // Code igniter instance
|
||||
private $_who; // who added this document
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct($params = null)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
// Set the the _who property
|
||||
$this->_who = 'Akte system'; // default
|
||||
// It is possible to set it using the who parameter
|
||||
if (!isEmptyArray($params) && isset($params['who']) && !isEmptyString($params['who'])) $this->_who = $params['who'];
|
||||
|
||||
$this->_ci->load->model('crm/Akte_model', 'AkteModel');
|
||||
$this->_ci->load->model('content/DmsFS_model', 'DmsFSModel');
|
||||
|
||||
$this->_ci->load->library('DmsLib');
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a new file, adds a new dms entry with given akte data,
|
||||
* adds a new dms version 0 for the written file, and adds Akte if dms add was successfull
|
||||
* Returns success with inserted akte id or error
|
||||
*/
|
||||
public function add(
|
||||
$person_id, $dokument_kurzbz, $titel, $mimetype, $fileHandle, // Required parameters
|
||||
$bezeichnung = null, $archiv = false, $signiert = false, $stud_selfservice = false
|
||||
)
|
||||
{
|
||||
// add new dms entry and new dms version for the Akte, using Akte data (title, mimetype, file content as handle)
|
||||
$dmsAddResult = $this->_ci->dmslib->add($titel, $mimetype, $fileHandle, self::AKTE_KATEGORIE_KURZBZ, $dokument_kurzbz, $bezeichnung);
|
||||
|
||||
if (isError($dmsAddResult)) return $dmsAddResult;
|
||||
|
||||
if (!hasData($dmsAddResult)) return error("Dms document could not be added");
|
||||
|
||||
$dmsAddData = getData($dmsAddResult);
|
||||
|
||||
// insert the Akte
|
||||
return $this->_ci->AkteModel->insert(
|
||||
array(
|
||||
'person_id' => $person_id,
|
||||
'dokument_kurzbz' => $dokument_kurzbz,
|
||||
'titel' => $titel,
|
||||
'mimetype' => $mimetype,
|
||||
'bezeichnung' => $bezeichnung,
|
||||
'erstelltam' => date('Y-m-d'),
|
||||
'dms_id' => $dmsAddData->dms_id,
|
||||
'archiv' => $archiv,
|
||||
'signiert' => $signiert,
|
||||
'stud_selfservice' => $stud_selfservice,
|
||||
'insertamum' => date('Y-m-d H:i:s'),
|
||||
'insertvon' => $this->_who
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a new file, adds a new dms version 0 for the written file, and updates Akte if dms version add was successfull
|
||||
* Returns success with updated akte id or error
|
||||
*/
|
||||
public function update($akte_id, $titel, $mimetype, $fileHandle, $bezeichnung = null, $archiv = false, $signiert = false, $stud_selfservice = false)
|
||||
{
|
||||
// check if Akte with dms exists
|
||||
$this->_ci->AkteModel->addSelect('dms_id');
|
||||
$akteResult = $this->_ci->AkteModel->load($akte_id);
|
||||
|
||||
if (isError($akteResult)) return $akteResult;
|
||||
|
||||
if (!hasData($akteResult)) return error("Akte not found");
|
||||
|
||||
$dms_id = getData($akteResult)[0]->dms_id;
|
||||
|
||||
if (isEmptyString($dms_id)) return error("Akte has no dms document");
|
||||
|
||||
// if Akte with dms found, update the last dms version
|
||||
$dmsUpdateResult = $this->_ci->dmslib->updateLastVersion($dms_id, $fileHandle, $titel, $mimetype, $bezeichnung);
|
||||
|
||||
if (isError($dmsUpdateResult)) return $dmsUpdateResult;
|
||||
|
||||
if (!hasData($dmsUpdateResult)) return error("Dms document could not be updated");
|
||||
|
||||
// update the Akte
|
||||
return $this->_ci->AkteModel->update(
|
||||
$akte_id,
|
||||
array(
|
||||
'titel' => $titel,
|
||||
'mimetype' => $mimetype,
|
||||
'bezeichnung' => $bezeichnung,
|
||||
'erstelltam' => date('Y-m-d'),
|
||||
'dms_id' => $dms_id,
|
||||
'archiv' => $archiv,
|
||||
'signiert' => $signiert,
|
||||
'stud_selfservice' => $stud_selfservice,
|
||||
'updateamum' => date('Y-m-d H:i:s'),
|
||||
'updatevon' => $this->_who
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets akte data and associated dms data by akte Id
|
||||
* Returns success with akte and dms data or error
|
||||
*/
|
||||
public function get($akte_id)
|
||||
{
|
||||
// get Akte data
|
||||
$this->_ci->AkteModel->addSelect('person_id, dokument_kurzbz, mimetype, erstelltam, titel, bezeichnung,
|
||||
gedruckt, uid, dms_id, nachgereicht, nachgereicht_am, anmerkung,
|
||||
ausstellungsnation, formal_geprueft_amum, archiv, signiert,
|
||||
stud_selfservice, akzeptiertamum, insertvon, insertamum, updatevon, updateamum');
|
||||
$this->_ci->AkteModel->load($akte_id);
|
||||
$akteResult = $this->_ci->AkteModel->load($akte_id);
|
||||
|
||||
if (isError($akteResult)) return $akteResult;
|
||||
|
||||
if (!hasData($akteResult)) return error("Akte not found");
|
||||
|
||||
$resultObject = getData($akteResult)[0];
|
||||
|
||||
// set properties with same name in Akte and Dms table
|
||||
$resultObject->akte_mimetype = $resultObject->mimetype;
|
||||
|
||||
// get dms data
|
||||
$dmsResult = $this->_ci->dmslib->getLastVersion($resultObject->dms_id);
|
||||
|
||||
if (isError($dmsResult)) return $dmsResult;
|
||||
|
||||
// properties to retrieve from dms
|
||||
$dmsProperties = array('version', 'filename', 'mimetype', 'name', 'beschreibung', 'cis_suche', 'schlagworte', DmsLib::FILE_CONTENT_PROPERTY);
|
||||
|
||||
// set dms properties
|
||||
if (hasData($dmsResult))
|
||||
{
|
||||
$dmsData = getData($dmsResult);
|
||||
|
||||
foreach ($dmsProperties as $dmsProperty)
|
||||
{
|
||||
$resultObject->{$dmsProperty} = $dmsData->{$dmsProperty};
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// set null if no dms result found
|
||||
foreach ($dmsProperties as $dmsProperty)
|
||||
{
|
||||
$resultObject->{$dmsProperty} = null;
|
||||
}
|
||||
}
|
||||
|
||||
// return the object containing akte and dms data
|
||||
return success($resultObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Akte data and associated dms data by person Id and dokument_kurzbz
|
||||
* Returns success with result array with akte and dms data or error
|
||||
*/
|
||||
public function getByPersonIdAndDocumentType($person_id, $dokument_kurzbz)
|
||||
{
|
||||
// load all Akte entries for given person and dokument_kurzbz
|
||||
$this->_ci->AkteModel->addSelect('akte_id');
|
||||
$akteResult = $this->_ci->AkteModel->loadWhere(
|
||||
array(
|
||||
'person_id' => $person_id,
|
||||
'dokument_kurzbz' => $dokument_kurzbz
|
||||
)
|
||||
);
|
||||
|
||||
if (!hasData($akteResult)) return error("Akte not found");
|
||||
|
||||
$akteData = getData($akteResult);
|
||||
|
||||
$resultArr = array();
|
||||
|
||||
// for each found akte entry
|
||||
foreach ($akteData as $akte)
|
||||
{
|
||||
// get dms and akte data from akte Id
|
||||
$getAkteDmsResult = $this->get($akte->akte_id);
|
||||
|
||||
if (isError($getAkteDmsResult)) return $getAkteDmsResult;
|
||||
|
||||
$resultArr[] = getData($getAkteDmsResult);
|
||||
}
|
||||
|
||||
// return all found entries
|
||||
return success($resultArr);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes Akte by akte Id, removes all associated dms entries and versions, and deletes all associated files
|
||||
* Returns success with removed version numbers or error
|
||||
*/
|
||||
public function remove($akte_id)
|
||||
{
|
||||
// get dms_id for akte
|
||||
$this->_ci->AkteModel->addSelect('dms_id');
|
||||
$akteResult = $this->_ci->AkteModel->load($akte_id);
|
||||
|
||||
if (isError($akteResult)) return $akteResult;
|
||||
|
||||
if (!hasData($akteResult)) return error("Akte not found");
|
||||
|
||||
$dms_id = getData($akteResult)[0]->dms_id;
|
||||
$error = null;
|
||||
|
||||
// Start DB transaction to avoid deleting only part of the data
|
||||
$this->_ci->db->trans_begin();
|
||||
|
||||
// delete Akte
|
||||
$deleteResult = $this->_ci->AkteModel->delete($akte_id);
|
||||
|
||||
if (isError($deleteResult))
|
||||
{
|
||||
$error = $deleteResult;
|
||||
}
|
||||
else
|
||||
{
|
||||
// remove all dms entry for dms of the akte
|
||||
$removeAllResult = $this->_ci->dmslib->removeAll($dms_id);
|
||||
|
||||
if (isError($removeAllResult))
|
||||
$error = $removeAllResult;
|
||||
}
|
||||
|
||||
// Transaction complete!
|
||||
$this->_ci->db->trans_complete();
|
||||
|
||||
// Check if everything went ok during the transaction
|
||||
if ($this->_ci->db->trans_status() === false || isset($error))
|
||||
{
|
||||
$this->_ci->db->trans_rollback();
|
||||
|
||||
// return occured error
|
||||
if (isset($error))
|
||||
return $error;
|
||||
else
|
||||
return error("Error occured when deleting, rolled back");
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_ci->db->trans_commit();
|
||||
|
||||
// return removed dms entry data
|
||||
return $removeAllResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,15 +80,26 @@ class AnrechnungLib
|
||||
// Get latest ZGV
|
||||
$result = $this->ci->PrestudentModel->getLatestZGVBezeichnung($prestudent_id);
|
||||
$latest_zgv_bezeichnung = hasData($result) ? getData($result)[0]->bezeichnung : '';
|
||||
|
||||
|
||||
// Get Sum of berufliche and schulische ECTS
|
||||
$result = $this->ci->LehrveranstaltungModel->getEctsSumSchulisch($uid, $prestudent_id, $lv->studiengang_kz);
|
||||
$sumEctsSchulisch = getData($result)[0]->ectssumschulisch;
|
||||
|
||||
$result = $this->ci->LehrveranstaltungModel->getEctsSumBeruflich($uid);
|
||||
$sumEctsBeruflich = getData($result)[0]->ectssumberuflich;
|
||||
|
||||
// Set the given studiensemester
|
||||
$antrag_data->lv_id = $lv_id;
|
||||
$antrag_data->lv_bezeichnung = $lv->bezeichnung;
|
||||
$antrag_data->ects = $lv->ects;
|
||||
$antrag_data->sumEctsSchulisch = $sumEctsSchulisch;
|
||||
$antrag_data->sumEctsBeruflich = $sumEctsBeruflich;
|
||||
$antrag_data->studiensemester_kurzbz = $studiensemester_kurzbz;
|
||||
$antrag_data->vorname = $person->vorname;
|
||||
$antrag_data->nachname = $person->nachname;
|
||||
$antrag_data->student_uid = $uid;
|
||||
$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;
|
||||
@@ -111,6 +122,7 @@ class AnrechnungLib
|
||||
|
||||
$anrechnung_data = new StdClass();
|
||||
|
||||
$this->ci->AnrechnungModel->addJoin('lehre.tbl_anrechnung_begruendung', 'begruendung_id');
|
||||
$result = $this->ci->AnrechnungModel->load($anrechnung_id);
|
||||
|
||||
if (isError($result))
|
||||
@@ -144,6 +156,7 @@ class AnrechnungLib
|
||||
$anrechnung_data->prestudent_id = '';
|
||||
$anrechnung_data->lehrveranstaltung = '';
|
||||
$anrechnung_data->begruendung_id = '';
|
||||
$anrechnung_data->begruendung = '';
|
||||
$anrechnung_data->anmerkung = '';
|
||||
$anrechnung_data->dms_id = '';
|
||||
$anrechnung_data->insertamum = '';
|
||||
@@ -154,6 +167,7 @@ class AnrechnungLib
|
||||
$anrechnung_data->status = getUserLanguage() == 'German' ? 'neu' : 'new';
|
||||
$anrechnung_data->dokumentname = '';
|
||||
|
||||
$this->ci->AnrechnungModel->addJoin('lehre.tbl_anrechnung_begruendung', 'begruendung_id');
|
||||
$result = $this->ci->AnrechnungModel->loadWhere(
|
||||
array(
|
||||
'lehrveranstaltung_id' => $lehrveranstaltung_id,
|
||||
@@ -799,6 +813,7 @@ class AnrechnungLib
|
||||
$anrechnung_data->prestudent_id = $anrechnung->prestudent_id;
|
||||
$anrechnung_data->lehrveranstaltung_id = $anrechnung->lehrveranstaltung_id;
|
||||
$anrechnung_data->begruendung_id = $anrechnung->begruendung_id;
|
||||
$anrechnung_data->begruendung = $anrechnung->bezeichnung;
|
||||
$anrechnung_data->anmerkung = $anrechnung->anmerkung_student;
|
||||
$anrechnung_data->dms_id = $anrechnung->dms_id;
|
||||
$anrechnung_data->insertamum = (new DateTime($anrechnung->insertamum))->format('d.m.Y');
|
||||
@@ -822,4 +837,110 @@ class AnrechnungLib
|
||||
|
||||
return $anrechnung_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* If Student is a Quereinsteiger, get ECTS Summe of all angerechnete Studiensemester.
|
||||
*
|
||||
* @param $prestudent_id
|
||||
* @param $studiengang_kz Studiengang_kz der LV
|
||||
* @return int|mixed
|
||||
*/
|
||||
public function getQuereinsteigerEctsSumme($prestudent_id, $studiengang_kz)
|
||||
{
|
||||
$sumEctsQuereinsteiger = 0;
|
||||
|
||||
// Check, if student is Quereinsteiger
|
||||
$this->ci->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
$result = $this->ci->PrestudentstatusModel->getFirstStatus($prestudent_id, 'Student');
|
||||
|
||||
$prestudentFirstStudentStatus = getData($result)[0];
|
||||
|
||||
// If Prestudent is not a Quereinsteiger
|
||||
if ($prestudentFirstStudentStatus->ausbildungssemester == 1)
|
||||
{
|
||||
return $sumEctsQuereinsteiger; // return 0
|
||||
}
|
||||
|
||||
$anzahlAngerechneteStudiensemester = $prestudentFirstStudentStatus->ausbildungssemester - 1;
|
||||
|
||||
// If Prestudent is a Quereinsteiger
|
||||
if ($prestudentFirstStudentStatus->ausbildungssemester > 1)
|
||||
{
|
||||
// Get the 'angerechnete Studiensemester'
|
||||
$this->ci->load->model('organisations/Studiensemester_model', 'StudiensemesterModel');
|
||||
$result = $this->ci->StudiensemesterModel->getPreviousFrom(
|
||||
$prestudentFirstStudentStatus->studiensemester_kurzbz,
|
||||
$anzahlAngerechneteStudiensemester
|
||||
);
|
||||
|
||||
// Get ECTS Summe of each 'angerechnetes Studiensemester'
|
||||
foreach (getData($result) as $studiensemester)
|
||||
{
|
||||
$result = $this->ci->LehrveranstaltungModel->getSumQuereinstiegsECTSProSemester(
|
||||
$studiengang_kz,
|
||||
$studiensemester->studiensemester_kurzbz,
|
||||
$anzahlAngerechneteStudiensemester--,
|
||||
$prestudentFirstStudentStatus->orgform_kurzbz
|
||||
);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$sumEctsQuereinsteiger = $sumEctsQuereinsteiger + getData($result)[0]->sum_ects;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $sumEctsQuereinsteiger; // return sum of ects of all 'angerechnete Studiensemester'
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ECTS Summe of all Anrechnungen based on schulische Kenntnisse.
|
||||
*
|
||||
* @param $student_uid
|
||||
* @return int|mixed
|
||||
*/
|
||||
public function getSchulischeAnrechnungenEctsSumme($student_uid)
|
||||
{
|
||||
$sumEctsSchule = 0;
|
||||
|
||||
$result = $this->ci->LehrveranstaltungModel->getSumAngerechneteECTSByBegruendung($student_uid);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
foreach (getData($result) as $ects)
|
||||
{
|
||||
if ($ects->begruendung_id != 4)
|
||||
{
|
||||
$sumEctsSchule = $sumEctsSchule + $ects->sum;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $sumEctsSchule;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ECTS Summe of all Anrechnungen based on berufliche Kenntnisse.
|
||||
*
|
||||
* @param $student_uid
|
||||
* @return int
|
||||
*/
|
||||
public function getBeruflicheAnrechnungenEctsSumme($student_uid)
|
||||
{
|
||||
$sumEctsBeruflich = 0;
|
||||
|
||||
$result = $this->ci->LehrveranstaltungModel->getSumAngerechneteECTSByBegruendung($student_uid);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
foreach (getData($result) as $ects)
|
||||
{
|
||||
if ($ects->begruendung_id == 4)
|
||||
{
|
||||
$sumEctsBeruflich = $ects->sum;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $sumEctsBeruflich;
|
||||
}
|
||||
}
|
||||
|
||||
+633
-141
@@ -1,25 +1,532 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-Helper
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2022 fhcomplete.net
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class DmsLib extends FHC_Controller
|
||||
use \stdClass as stdClass;
|
||||
|
||||
class DmsLib
|
||||
{
|
||||
const FILE_CONTENT_PROPERTY = 'file_content';
|
||||
|
||||
private $UPLOAD_PATH = DMS_PATH; // temporary directory to store the upload file
|
||||
const FILE_CONTENT_PROPERTY = 'file_content'; // property name for file content
|
||||
|
||||
private $_ci; // code igniter instance
|
||||
private $_who; // who added this document
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
public function __construct($params = null)
|
||||
{
|
||||
$this->ci =& get_instance();
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->ci->load->model('crm/Akte_model', 'AkteModel');
|
||||
$this->ci->load->model('content/Dms_model', 'DmsModel');
|
||||
$this->ci->load->model('content/DmsVersion_model', 'DmsVersionModel');
|
||||
$this->ci->load->model('content/DmsFS_model', 'DmsFSModel');
|
||||
// Set the the _who property
|
||||
$this->_who = 'DMS system'; // default
|
||||
// It is possible to set it using the who parameter
|
||||
if (!isEmptyArray($params) && isset($params['who']) && !isEmptyString($params['who'])) $this->_who = $params['who'];
|
||||
|
||||
$this->_ci->load->model('crm/Akte_model', 'AkteModel'); // deprecated, should not be used here!
|
||||
$this->_ci->load->model('content/Dms_model', 'DmsModel');
|
||||
$this->_ci->load->model('content/DmsVersion_model', 'DmsVersionModel');
|
||||
$this->_ci->load->model('content/DmsFS_model', 'DmsFSModel');
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Writes a new file, adds a new dms entry and a new dms version 0 for the written file
|
||||
* Returns success info of added dms entry (dms_id, version, filename) or error
|
||||
*/
|
||||
public function add(
|
||||
$name, $mimetype, $fileHandle, // Required parameters
|
||||
$kategorie_kurzbz = null, $dokument_kurzbz = null, $beschreibung = null, $cis_suche = false, $schlagworte = null
|
||||
)
|
||||
{
|
||||
// write file with content of fileHandle
|
||||
$writeFileResult = $this->_writeNewFile($name, $fileHandle);
|
||||
|
||||
if (isError($writeFileResult)) return $writeFileResult;
|
||||
|
||||
if (hasData($writeFileResult))
|
||||
{
|
||||
$writeFileData = getData($writeFileResult);
|
||||
$filename = $writeFileData->filename;
|
||||
|
||||
// if file written successful, insert dms
|
||||
$dmsResult = $this->_ci->DmsModel->insert(
|
||||
array(
|
||||
'kategorie_kurzbz' => $kategorie_kurzbz,
|
||||
'dokument_kurzbz' => $dokument_kurzbz
|
||||
)
|
||||
);
|
||||
|
||||
if (isError($dmsResult)) return $dmsResult;
|
||||
|
||||
if (hasData($dmsResult))
|
||||
{
|
||||
$dms_id = getData($dmsResult);
|
||||
$version = 0;
|
||||
|
||||
// insert dms version
|
||||
$dmsVersion = array(
|
||||
'dms_id' => $dms_id,
|
||||
'version' => $version,
|
||||
'filename' => $filename,
|
||||
'mimetype' => $mimetype,
|
||||
'name' => $name,
|
||||
'beschreibung' => $beschreibung,
|
||||
'cis_suche' => $cis_suche,
|
||||
'schlagworte' => $schlagworte,
|
||||
'insertvon' => $this->_who,
|
||||
'insertamum' => date('Y-m-d H:i:s')
|
||||
);
|
||||
|
||||
$dmsVersionResult = $this->_ci->DmsVersionModel->insert($dmsVersion);
|
||||
|
||||
if (isError($dmsVersionResult)) return $dmsVersionResult;
|
||||
|
||||
// return dms info
|
||||
$resObj = new stdClass();
|
||||
$resObj->dms_id = $dms_id;
|
||||
$resObj->version = $version;
|
||||
$resObj->filename = $filename;
|
||||
|
||||
return success($resObj);
|
||||
}
|
||||
else
|
||||
return error("error when inserting DMS");
|
||||
}
|
||||
else
|
||||
return error("file could not be written");
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a new file with content of fileHandle, adds a new dms version (max version number + 1) for the written file
|
||||
* Returns success with info of added dms version (version, filename) or error
|
||||
*/
|
||||
public function addNewVersion($dms_id, $fileHandle, $name = null, $mimetype = null, $beschreibung = null, $cis_suche = false, $schlagworte = null)
|
||||
{
|
||||
// get the latest version
|
||||
$lastVersionResult = $this->getLastVersion($dms_id);
|
||||
|
||||
if (isError($lastVersionResult)) return $lastVersionResult;
|
||||
|
||||
if (hasData($lastVersionResult))
|
||||
{
|
||||
$lastVersion = getData($lastVersionResult);
|
||||
|
||||
$originalName = isset($name) ? $name : $lastVersion->name;
|
||||
|
||||
// write new file with content of fileHandle
|
||||
$writeFileResult = $this->_writeNewFile($originalName, $fileHandle);
|
||||
|
||||
if (isError($writeFileResult)) return $writeFileResult;
|
||||
|
||||
if (hasData($writeFileResult))
|
||||
{
|
||||
$writeFileData = getData($writeFileResult);
|
||||
$filename = $writeFileData->filename;
|
||||
|
||||
// insert new version
|
||||
$newVersionNumber = $lastVersion->version + 1;
|
||||
|
||||
// if new parameters given, use them, otherwise use parameters from last version
|
||||
$newVersion = array(
|
||||
'dms_id' => $dms_id,
|
||||
'name' => $originalName,
|
||||
'filename' => $filename,
|
||||
'version' => $newVersionNumber,
|
||||
'mimetype' => isset($mimetype) ? $mimetype : $lastVersion->mimetype,
|
||||
'beschreibung' => isset($beschreibung) ? $beschreibung : $lastVersion->beschreibung,
|
||||
'cis_suche' => isset($cis_suche) ? $cis_suche : $lastVersion->cis_suche,
|
||||
'schlagworte' => isset($schlagworte) ? $schlagworte : $lastVersion->schlagworte,
|
||||
'insertvon' => $this->_who,
|
||||
'insertamum' => date('Y-m-d H:i:s')
|
||||
);
|
||||
|
||||
$addVersionResult = $this->_ci->DmsVersionModel->insert($newVersion);
|
||||
|
||||
if (isError($addVersionResult)) return $addVersionResult;
|
||||
|
||||
// return dms info
|
||||
$resObj = new stdClass();
|
||||
$resObj->version = $newVersionNumber;
|
||||
$resObj->filename = $filename;
|
||||
|
||||
return success($resObj);
|
||||
}
|
||||
else
|
||||
return error("file could not be written");
|
||||
}
|
||||
else
|
||||
return error("last version not found");
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the last version (max version number) of a dms entry
|
||||
* Overwrites the file associated with this version with content read from fileHandle
|
||||
* Returns success with info of added dms version (version, filename) or error
|
||||
*/
|
||||
public function updateLastVersion($dms_id, $fileHandle, $name = null, $mimetype = null, $beschreibung = null, $cis_suche = false, $schlagworte = null)
|
||||
{
|
||||
// get the latest version
|
||||
$lastVersionResult = $this->getLastVersion($dms_id);
|
||||
|
||||
if (isError($lastVersionResult)) return $lastVersionResult;
|
||||
|
||||
if (hasData($lastVersionResult))
|
||||
{
|
||||
$lastVersion = getData($lastVersionResult);
|
||||
|
||||
// update file in filesystem
|
||||
$writeFileResult = $this->_writeFile($lastVersion->filename, $fileHandle);
|
||||
|
||||
if (isError($writeFileResult)) return $writeFileResult;
|
||||
|
||||
if (hasData($writeFileResult))
|
||||
{
|
||||
$writeFileData = getData($writeFileResult);
|
||||
$filename = $writeFileData->filename;
|
||||
|
||||
// if new parameters given, use them, otherwise use parameters from last version
|
||||
$newVersion = array(
|
||||
'name' => isset($name) ? $name : $lastVersion->name,
|
||||
'filename' => $filename,
|
||||
'mimetype' => isset($mimetype) ? $mimetype : $lastVersion->mimetype,
|
||||
'beschreibung' => isset($beschreibung) ? $beschreibung : $lastVersion->beschreibung,
|
||||
'cis_suche' => isset($cis_suche) ? $cis_suche : $lastVersion->cis_suche,
|
||||
'schlagworte' => isset($schlagworte) ? $schlagworte : $lastVersion->schlagworte,
|
||||
);
|
||||
|
||||
// update last dms version
|
||||
$addVersionResult = $this->_ci->DmsVersionModel->update(
|
||||
array($dms_id, $lastVersion->version),
|
||||
$newVersion
|
||||
);
|
||||
|
||||
if (isError($addVersionResult)) return $addVersionResult;
|
||||
|
||||
// return dms info
|
||||
$resObj = new stdClass();
|
||||
$resObj->version = $lastVersion->version;
|
||||
$resObj->filename = $filename;
|
||||
|
||||
return success($resObj);
|
||||
}
|
||||
else
|
||||
return error("file could not be written");
|
||||
}
|
||||
else
|
||||
return error("last version not found");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets dms version with highest number
|
||||
* Returns success with dms data and fileHandle with file content or error
|
||||
*/
|
||||
public function getLastVersion($dms_id)
|
||||
{
|
||||
// get the latest version number
|
||||
$this->_ci->DmsVersionModel->addSelect('version');
|
||||
$this->_ci->DmsVersionModel->addOrder('version', 'DESC');
|
||||
$this->_ci->DmsVersionModel->addOrder('insertamum', 'DESC');
|
||||
$this->_ci->DmsVersionModel->addLimit(1);
|
||||
$lastDmsVersionResult = $this->_ci->DmsVersionModel->loadWhere(
|
||||
array('dms_id' => $dms_id)
|
||||
);
|
||||
|
||||
if (isError($lastDmsVersionResult)) return $lastDmsVersionResult;
|
||||
|
||||
if (hasData($lastDmsVersionResult))
|
||||
{
|
||||
$lastDmsVersionData = getData($lastDmsVersionResult)[0];
|
||||
$lastDmsVersion = $lastDmsVersionData->version;
|
||||
|
||||
// call get Version with last version number
|
||||
return $this->getVersion($dms_id, $lastDmsVersion);
|
||||
}
|
||||
else
|
||||
return error("Dms last version not found");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets specified dms version
|
||||
* Returns success with dms data and fileHandle with file content or error
|
||||
*/
|
||||
public function getVersion($dms_id, $version)
|
||||
{
|
||||
$this->_ci->DmsVersionModel->addSelect('dms_id, version, filename, mimetype, name, beschreibung, cis_suche, schlagworte');
|
||||
$dmsVersionResult = $this->_ci->DmsVersionModel->loadWhere(
|
||||
array(
|
||||
'dms_id' => $dms_id,
|
||||
'version' => $version
|
||||
)
|
||||
);
|
||||
|
||||
if (isError($dmsVersionResult)) return $dmsVersionResult;
|
||||
|
||||
if (hasData($dmsVersionResult))
|
||||
{
|
||||
$dmsVersion = getData($dmsVersionResult)[0];
|
||||
|
||||
// get file content as file pointer
|
||||
$fileHandleResult = $this->_ci->DmsFSModel->openRead($dmsVersion->filename);
|
||||
|
||||
if (isError($fileHandleResult)) return $fileHandleResult;
|
||||
|
||||
if (hasData($fileHandleResult))
|
||||
{
|
||||
$fileHandle = getData($fileHandleResult);
|
||||
$dmsVersion->{self::FILE_CONTENT_PROPERTY} = $fileHandle;
|
||||
|
||||
// close file pointer
|
||||
$closeResult = $this->_ci->DmsFSModel->close($fileHandle);
|
||||
|
||||
if (isError($closeResult)) return $closeResult;
|
||||
|
||||
return success($dmsVersion);
|
||||
}
|
||||
else
|
||||
return error("File could not be opened");
|
||||
}
|
||||
else
|
||||
return error("Dms version not found");
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes dms entry and all its versions, deletes all associated files
|
||||
* Returns success with removed version numbers or error
|
||||
*/
|
||||
public function removeAll($dms_id)
|
||||
{
|
||||
$versionsRemoved = array();
|
||||
|
||||
$this->_ci->DmsVersionModel->addSelect('version, filename');
|
||||
$allVersionsResult = $this->_ci->DmsVersionModel->loadWhere(array('dms_id' => $dms_id));
|
||||
|
||||
if (hasData($allVersionsResult))
|
||||
{
|
||||
$allVersionsData = getData($allVersionsResult);
|
||||
|
||||
$error = null;
|
||||
|
||||
// Start DB transaction to avoid deleting only part of the data
|
||||
$this->_ci->db->trans_begin();
|
||||
|
||||
// remove all versions of the dms Id
|
||||
foreach ($allVersionsData as $version)
|
||||
{
|
||||
$removeVersionResult = $this->removeVersion($dms_id, $version->version);
|
||||
|
||||
if (isError($removeVersionResult))
|
||||
{
|
||||
$error = $removeVersionResult;
|
||||
break;
|
||||
}
|
||||
else
|
||||
$versionsRemoved[] = $version; // return removed versions
|
||||
}
|
||||
|
||||
// Transaction complete!
|
||||
$this->_ci->db->trans_complete();
|
||||
|
||||
// Check if everything went ok during the transaction
|
||||
if ($this->_ci->db->trans_status() === false || isset($error))
|
||||
{
|
||||
$this->_ci->db->trans_rollback();
|
||||
|
||||
if (isset($error))
|
||||
return $error;
|
||||
else
|
||||
return error("Error occured when deleting, rolled back");
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_ci->db->trans_commit();
|
||||
}
|
||||
}
|
||||
|
||||
return success($versionsRemoved);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes latest version and its associated file
|
||||
* Returns success with removed dms version data (dms_id, version, filename) or error
|
||||
*/
|
||||
public function removeLastVersion($dms_id)
|
||||
{
|
||||
$lastVersionNumber = 0;
|
||||
// get the latest version
|
||||
$lastVersionResult = $this->getLastVersion($dms_id);
|
||||
|
||||
if (isError($lastVersionResult)) return $lastVersionResult;
|
||||
|
||||
if (hasData($lastVersionResult))
|
||||
{
|
||||
$lastVersion = getData($lastVersionResult);
|
||||
$lastVersionNumber = $lastVersion->version;
|
||||
}
|
||||
|
||||
// call remove method for latest version
|
||||
return $this->removeVersion($dms_id, $lastVersionNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes latest version and its associated file
|
||||
* Returns success with removed dms version data (dms_id, version, filename) or error
|
||||
*/
|
||||
public function removeVersion($dms_id, $version)
|
||||
{
|
||||
$removeVersionResultObj = new stdClass();
|
||||
$removeVersionResultObj->dms_id = null;
|
||||
$removeVersionResultObj->version = null;
|
||||
$removeVersionResultObj->filename = null;
|
||||
|
||||
// load dms version and check how many versions there are
|
||||
$db = new DB_Model();
|
||||
|
||||
$checkDeleteResult = $db->execReadOnlyQuery(
|
||||
"SELECT filename,
|
||||
(SELECT count(version)
|
||||
FROM campus.tbl_dms_version dv_anzahl
|
||||
WHERE dv_anzahl.dms_id = dv.dms_id) AS anzahl_versionen
|
||||
FROM campus.tbl_dms_version dv
|
||||
WHERE dms_id=?
|
||||
AND version=?",
|
||||
array($dms_id, $version)
|
||||
);
|
||||
|
||||
if (isError($checkDeleteResult)) return $checkDeleteResult;
|
||||
|
||||
if (hasData($checkDeleteResult))
|
||||
{
|
||||
$checkDeleteData = getData($checkDeleteResult)[0];
|
||||
|
||||
// delete version
|
||||
$deleteVersionResult = $this->_ci->DmsVersionModel->delete(array($dms_id, $version));
|
||||
|
||||
if (isError($deleteVersionResult)) return $deleteVersionResult;
|
||||
|
||||
$removeVersionResultObj->version = $version;
|
||||
$removeVersionResultObj->filename = $checkDeleteData->filename;
|
||||
|
||||
// delete dms too if no versions left
|
||||
if ($checkDeleteData->anzahl_versionen <= 1)
|
||||
{
|
||||
$deleteDmsResult = $this->_ci->DmsModel->delete($dms_id);
|
||||
|
||||
if (isError($deleteDmsResult)) return $deleteDmsResult;
|
||||
|
||||
$removeVersionResultObj->dms_id = $dms_id;
|
||||
}
|
||||
|
||||
// delete file from file system
|
||||
$removeResult = $this->_ci->DmsFSModel->remove($checkDeleteData->filename);
|
||||
|
||||
if (isError($removeResult)) return $removeResult;
|
||||
}
|
||||
|
||||
return success($removeVersionResultObj);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Writes file with content of fileHandle using original document name for file extension
|
||||
*/
|
||||
private function _writeNewFile($originalName, $fileHandle)
|
||||
{
|
||||
// create unique filename, using original document name to detect file extension
|
||||
$filename = $this->_getUniqueFilename($originalName);
|
||||
|
||||
// write the file
|
||||
return $this->_writeFile($filename, $fileHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes file with content of fileHandle
|
||||
* Returns number of bytes written and filename
|
||||
*/
|
||||
private function _writeFile($filename, $fileHandle)
|
||||
{
|
||||
// file content provided by fileHandle
|
||||
$fileContent = '';
|
||||
|
||||
$readBlockResult = success();
|
||||
|
||||
// While the end of the file is not reached and the read does not fail
|
||||
while (!feof($fileHandle) && isSuccess($readBlockResult = $this->_ci->DmsFSModel->readBlock($fileHandle)))
|
||||
{
|
||||
// Concatenate the content of the file
|
||||
$fileContent .= getData($readBlockResult);
|
||||
}
|
||||
|
||||
// If an error occurred while reading then return it
|
||||
if (isError($readBlockResult)) return $readBlockResult;
|
||||
|
||||
// open file for writing
|
||||
$openFileResult = $this->_ci->DmsFSModel->openReadWrite($filename);
|
||||
|
||||
if (isError($openFileResult)) return $openFileResult;
|
||||
|
||||
if (!hasData($openFileResult)) return error("File could not be opened");
|
||||
|
||||
$newFileHandle = getData($openFileResult);
|
||||
|
||||
// write file
|
||||
$writeFileResult = $this->_ci->DmsFSModel->write($newFileHandle, $fileContent);
|
||||
|
||||
if (isError($writeFileResult)) return $writeFileResult;
|
||||
|
||||
// return number of bytes written and filename
|
||||
$resObj = new stdClass();
|
||||
$resObj->bytesWritten = 0;
|
||||
$resObj->filename = '';
|
||||
|
||||
if (hasData($writeFileResult))
|
||||
{
|
||||
$resObj->bytesWritten = getData($writeFileResult);
|
||||
$resObj->filename = $filename;
|
||||
}
|
||||
|
||||
// close handle
|
||||
$closeResult = $this->_ci->DmsFSModel->close($newFileHandle, $fileContent);
|
||||
|
||||
if (isError($closeResult)) return $closeResult;
|
||||
|
||||
return success($resObj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates unique filename, appends file extension from document name
|
||||
* Returns the filename string
|
||||
*/
|
||||
private function _getUniqueFilename($dokname)
|
||||
{
|
||||
// create unique id
|
||||
$uniqueFilename = uniqid();
|
||||
|
||||
// getting extension of file from document name
|
||||
$fileExtension = pathinfo($dokname, PATHINFO_EXTENSION);
|
||||
|
||||
// if file extension found, append it
|
||||
if (!isEmptyString($fileExtension))
|
||||
$uniqueFilename .= '.'.$fileExtension;
|
||||
|
||||
return $uniqueFilename;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
// Deprecated methods, not to be used
|
||||
|
||||
/**
|
||||
* Load a DMS Document.
|
||||
@@ -33,19 +540,20 @@ class DmsLib extends FHC_Controller
|
||||
{
|
||||
if (is_numeric($dms_id))
|
||||
{
|
||||
$this->ci->DmsModel->addJoin('campus.tbl_dms_version', 'dms_id');
|
||||
$this->ci->DmsModel->addOrder('version', 'DESC');
|
||||
$this->ci->DmsModel->addLimit(1);
|
||||
$this->_ci->DmsModel->addJoin('campus.tbl_dms_version', 'dms_id');
|
||||
$this->_ci->DmsModel->addOrder('version', 'DESC');
|
||||
$this->_ci->DmsModel->addLimit(1);
|
||||
|
||||
if (!is_numeric($version))
|
||||
{
|
||||
return $this->ci->DmsModel->load($dms_id);
|
||||
return $this->_ci->DmsModel->load($dms_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->ci->DmsModel->loadWhere(array('dms_id' => $dms_id, 'version' => $version));
|
||||
return $this->_ci->DmsModel->loadWhere(array('dms_id' => $dms_id, 'version' => $version));
|
||||
}
|
||||
}
|
||||
|
||||
return error('The parameter DMS ID must be a number');
|
||||
}
|
||||
|
||||
@@ -57,34 +565,30 @@ class DmsLib extends FHC_Controller
|
||||
*/
|
||||
public function read($dms_id, $version = null)
|
||||
{
|
||||
$result = null;
|
||||
$result = error('Wrong dms_id parameter');
|
||||
|
||||
if (isset($dms_id))
|
||||
{
|
||||
$this->ci->DmsModel->addJoin('campus.tbl_dms_version', 'dms_id');
|
||||
$this->ci->DmsModel->addOrder('version', 'DESC');
|
||||
$this->ci->DmsModel->addLimit(1);
|
||||
$this->_ci->DmsModel->addJoin('campus.tbl_dms_version', 'dms_id');
|
||||
$this->_ci->DmsModel->addOrder('version', 'DESC');
|
||||
$this->_ci->DmsModel->addLimit(1);
|
||||
|
||||
if (!isset($version))
|
||||
{
|
||||
$result = $this->ci->DmsModel->load($dms_id);
|
||||
$result = $this->_ci->DmsModel->load($dms_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->ci->DmsModel->loadWhere(array('dms_id' => $dms_id, 'version' => $version));
|
||||
$result = $this->_ci->DmsModel->loadWhere(array('dms_id' => $dms_id, 'version' => $version));
|
||||
}
|
||||
}
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$resultFS = $this->ci->DmsFSModel->read($result->retval[0]->filename);
|
||||
if (isSuccess($resultFS))
|
||||
// If a dms has been found
|
||||
if (hasData($result))
|
||||
{
|
||||
$result->retval[0]->{DmsLib::FILE_CONTENT_PROPERTY} = $resultFS->retval;
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $resultFS;
|
||||
$resultFS = $this->_ci->DmsFSModel->readBase64(getData($result)[0]->filename);
|
||||
if (isError($resultFS)) return $resultFS; // if an error occurred return it
|
||||
|
||||
$result->retval[0]->{self::FILE_CONTENT_PROPERTY} = getData($resultFS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,22 +605,16 @@ class DmsLib extends FHC_Controller
|
||||
*/
|
||||
public function getAktenAcceptedDms($person_id, $dokument_kurzbz = null, $no_file = null)
|
||||
{
|
||||
$result = $this->ci->AkteModel->getAktenAcceptedDms($person_id, $dokument_kurzbz);
|
||||
$result = $this->_ci->AkteModel->getAktenAcceptedDms($person_id, $dokument_kurzbz);
|
||||
|
||||
if (hasData($result) && $no_file == null)
|
||||
{
|
||||
$cnt = count($result->retval);
|
||||
for ($i = 0; $i < $cnt; $i++)
|
||||
for ($i = 0; $i < count(getData($result)); $i++)
|
||||
{
|
||||
$resultFS = $this->ci->DmsFSModel->read($result->retval[$i]->filename);
|
||||
if (isSuccess($resultFS))
|
||||
{
|
||||
$result->retval[$i]->{DmsLib::FILE_CONTENT_PROPERTY} = $resultFS->retval;
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $resultFS;
|
||||
}
|
||||
$resultFS = $this->_ci->DmsFSModel->readBase64(getData($result)[$i]->filename);
|
||||
if (isError($resultFS)) return $resultFS; // if an error occurred return it
|
||||
|
||||
$result->retval[$i]->{self::FILE_CONTENT_PROPERTY} = getData($resultFS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,30 +633,31 @@ class DmsLib extends FHC_Controller
|
||||
// Init upload configs
|
||||
$this->_loadUploadLibrary($allowed_types);
|
||||
|
||||
if (!$this->ci->upload->do_upload($field_name))
|
||||
if (!$this->_ci->upload->do_upload($field_name))
|
||||
{
|
||||
return error($this->ci->upload->display_errors());
|
||||
return error($this->_ci->upload->display_errors());
|
||||
}
|
||||
|
||||
$upload_data = $this->ci->upload->data(); // data about the uploaded file
|
||||
$filename = $upload_data['file_name'];
|
||||
$upload_data = $this->_ci->upload->data(); // data about the uploaded file
|
||||
|
||||
// Insert to DMS table
|
||||
if (!$result = $this->ci->DmsModel->insert($this->ci->DmsModel->filterFields($dms)))
|
||||
{
|
||||
return error('Failed inserting to DMS');
|
||||
}
|
||||
$upload_data['dms_id'] = $result->retval;
|
||||
$insDmsResult = $this->_ci->DmsModel->insert($this->_ci->DmsModel->filterFields($dms));
|
||||
if (isError($insDmsResult)) return $insDmsResult;
|
||||
|
||||
$upload_data['dms_id'] = getData($insDmsResult);
|
||||
|
||||
// Insert DMS version
|
||||
if (!$result = $this->ci->DmsVersionModel->insert(
|
||||
$this->ci->DmsVersionModel->filterFields($dms, $result->retval, $filename)))
|
||||
{
|
||||
return error('Failed inserting DMS version');
|
||||
}
|
||||
$insVersionResult = $this->_ci->DmsVersionModel->insert(
|
||||
$this->_ci->DmsVersionModel->filterFields(
|
||||
$dms,
|
||||
$upload_data['dms_id'],
|
||||
$upload_data['file_name']
|
||||
)
|
||||
);
|
||||
if (isError($insVersionResult)) return $insVersionResult;
|
||||
|
||||
// return result of uploaded data
|
||||
return success($upload_data); // data about the uploaded file
|
||||
// Return result of uploaded data
|
||||
return success($upload_data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -171,36 +670,29 @@ class DmsLib extends FHC_Controller
|
||||
*/
|
||||
public function download($dms_id, $filename = null, $disposition = 'inline')
|
||||
{
|
||||
$result = $this->getFileInfo($dms_id);
|
||||
|
||||
if (isError($result))
|
||||
// Retrieves info about the given dms
|
||||
$fileInfoResult = $this->getFileInfo($dms_id);
|
||||
if (isError($fileInfoResult)) return error(getError($fileInfoResult));
|
||||
|
||||
// If data have been found
|
||||
if (hasData($fileInfoResult))
|
||||
{
|
||||
return error(getError($result));
|
||||
$fileObj = getData($fileInfoResult);
|
||||
|
||||
// Change filename, if filename is provided
|
||||
if (!isEmptyString($filename)) $fileObj->name = $filename;
|
||||
|
||||
// Add file disposition if disposition has a valid value
|
||||
if ($disposition == 'attachment' || $disposition == 'inline')
|
||||
{
|
||||
$fileObj->disposition = $disposition;
|
||||
}
|
||||
|
||||
return success($fileObj);
|
||||
}
|
||||
|
||||
$fileObj = getData($result);
|
||||
|
||||
// Change filename, if filename is provided
|
||||
if (is_string($filename))
|
||||
{
|
||||
$fileObj->name = $filename;
|
||||
}
|
||||
|
||||
// Add file disposition
|
||||
if ($disposition == 'attachment')
|
||||
{
|
||||
$fileObj->disposition = 'attachment';
|
||||
}
|
||||
else
|
||||
{
|
||||
$fileObj->disposition = 'inline';
|
||||
}
|
||||
|
||||
// Output file
|
||||
if(!$this->outputFile($fileObj))
|
||||
{
|
||||
return error('Error on file output');
|
||||
}
|
||||
// If no data have been found then return an empty success
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -212,28 +704,28 @@ class DmsLib extends FHC_Controller
|
||||
*/
|
||||
public function getFileInfo($dms_id, $version = null)
|
||||
{
|
||||
if (!is_numeric($dms_id))
|
||||
{
|
||||
return error('Wrong parameter');
|
||||
}
|
||||
// Checks the dms_id parameter
|
||||
if (!is_numeric($dms_id)) return error('Wrong parameter');
|
||||
|
||||
// Load file
|
||||
// Load DMS from database
|
||||
$result = $this->load($dms_id, $version);
|
||||
if (isError($result)) return error(getError($result));
|
||||
|
||||
if (isError($result))
|
||||
// If data have been found
|
||||
if (hasData($result))
|
||||
{
|
||||
return error(getError($result));
|
||||
// Store file information in fileObj
|
||||
$fileObj = new stdClass();
|
||||
$fileObj->filename = getData($result)[0]->filename;
|
||||
$fileObj->file = DMS_PATH.getData($result)[0]->filename;
|
||||
$fileObj->name = DMS_PATH.getData($result)[0]->name; // original user filename
|
||||
$fileObj->mimetype = getData($result)[0]->mimetype;
|
||||
|
||||
return success($fileObj);
|
||||
}
|
||||
|
||||
// Store file information in fileObj
|
||||
$fileObj = new StdClass();
|
||||
$fileObj->filename = getData($result)[0]->filename;
|
||||
$fileObj->file = DMS_PATH. getData($result)[0]->filename;
|
||||
$fileObj->name = DMS_PATH. getData($result)[0]->name; // original users filename
|
||||
$fileObj->mimetype = DMS_PATH. getData($result)[0]->mimetype;
|
||||
|
||||
return success($fileObj);
|
||||
|
||||
// If no data have been found return an empty success
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -253,20 +745,20 @@ class DmsLib extends FHC_Controller
|
||||
$result = $this->_saveFileOnInsert($dms);
|
||||
if (isSuccess($result))
|
||||
{
|
||||
$filename = $result->retval;
|
||||
$filename = getData($result);
|
||||
if (isset($dms['dms_id']) && $dms['dms_id'] != '')
|
||||
{
|
||||
$result = $this->ci->DmsVersionModel->insert(
|
||||
$this->ci->DmsVersionModel->filterFields($dms, $dms['dms_id'], $filename)
|
||||
$result = $this->_ci->DmsVersionModel->insert(
|
||||
$this->_ci->DmsVersionModel->filterFields($dms, $dms['dms_id'], $filename)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->ci->DmsModel->insert($this->ci->DmsModel->filterFields($dms));
|
||||
$result = $this->_ci->DmsModel->insert($this->_ci->DmsModel->filterFields($dms));
|
||||
if (isSuccess($result))
|
||||
{
|
||||
$result = $this->ci->DmsVersionModel->insert(
|
||||
$this->ci->DmsVersionModel->filterFields($dms, $result->retval, $filename)
|
||||
$result = $this->_ci->DmsVersionModel->insert(
|
||||
$this->_ci->DmsVersionModel->filterFields($dms, getData($result), $filename)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -277,15 +769,15 @@ class DmsLib extends FHC_Controller
|
||||
$result = $this->_saveFileOnUpdate($dms);
|
||||
if (isSuccess($result))
|
||||
{
|
||||
$result = $this->ci->DmsModel->update($dms['dms_id'], $this->ci->DmsModel->filterFields($dms));
|
||||
$result = $this->_ci->DmsModel->update($dms['dms_id'], $this->_ci->DmsModel->filterFields($dms));
|
||||
if (isSuccess($result))
|
||||
{
|
||||
$result = $this->ci->DmsVersionModel->update(
|
||||
$result = $this->_ci->DmsVersionModel->update(
|
||||
array(
|
||||
$dms['dms_id'],
|
||||
$dms['version']
|
||||
),
|
||||
$this->ci->DmsVersionModel->filterFields($dms)
|
||||
$this->_ci->DmsVersionModel->filterFields($dms)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -308,56 +800,54 @@ class DmsLib extends FHC_Controller
|
||||
if (is_numeric($person_id) && is_numeric($dms_id))
|
||||
{
|
||||
// Start DB transaction
|
||||
$this->ci->db->trans_start(false);
|
||||
$this->_ci->db->trans_start(false);
|
||||
|
||||
// Get akte_id from table tbl_akte
|
||||
$result = $this->ci->AkteModel->loadWhere(array('person_id' => $person_id, 'dms_id' => $dms_id));
|
||||
$result = $this->_ci->AkteModel->loadWhere(array('person_id' => $person_id, 'dms_id' => $dms_id));
|
||||
if (isSuccess($result))
|
||||
{
|
||||
// Delete all entries in tbl_akte
|
||||
$cnt = count($result->retval);
|
||||
for ($i = 0; $i < $cnt; $i++)
|
||||
for ($i = 0; $i < count(getData($result)); $i++)
|
||||
{
|
||||
$this->ci->AkteModel->delete($result->retval[$i]->akte_id);
|
||||
$this->_ci->AkteModel->delete(getData($result)[$i]->akte_id);
|
||||
}
|
||||
|
||||
// Get all filenames related to this dms
|
||||
$resultFileNames = $this->ci->DmsVersionModel->loadWhere(array('dms_id' => $dms_id));
|
||||
$resultFileNames = $this->_ci->DmsVersionModel->loadWhere(array('dms_id' => $dms_id));
|
||||
if (isSuccess($resultFileNames))
|
||||
{
|
||||
// Delete from tbl_dms_version
|
||||
$result = $this->ci->DmsVersionModel->delete(array('dms_id' => $dms_id));
|
||||
$result = $this->_ci->DmsVersionModel->delete(array('dms_id' => $dms_id));
|
||||
if (isSuccess($result))
|
||||
{
|
||||
// Delete from tbl_dms
|
||||
$result = $this->ci->DmsModel->delete($dms_id);
|
||||
$result = $this->_ci->DmsModel->delete($dms_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Transaction complete!
|
||||
$this->ci->db->trans_complete();
|
||||
$this->_ci->db->trans_complete();
|
||||
|
||||
// Check if everything went ok during the transaction
|
||||
if ($this->ci->db->trans_status() === false || isError($result))
|
||||
if ($this->_ci->db->trans_status() === false || isError($result))
|
||||
{
|
||||
$this->ci->db->trans_rollback();
|
||||
$this->_ci->db->trans_rollback();
|
||||
$result = error('An error occurred while performing a delete operation', EXIT_ERROR);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->ci->db->trans_commit();
|
||||
$this->_ci->db->trans_commit();
|
||||
$result = success('Dms successfully removed from DB');
|
||||
}
|
||||
|
||||
// If everything is ok
|
||||
if (isSuccess($result))
|
||||
{
|
||||
$cnt = count($resultFileNames->retval);
|
||||
// Remove all files related to this person and dms
|
||||
for ($i = 0; $i < $cnt; $i++)
|
||||
for ($i = 0; $i < count(getData($resultFileNames)); $i++)
|
||||
{
|
||||
$this->ci->DmsFSModel->remove($resultFileNames->retval[$i]->filename);
|
||||
$this->_ci->DmsFSModel->removeBase64(getData($resultFileNames)[$i]->filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -376,19 +866,19 @@ class DmsLib extends FHC_Controller
|
||||
*/
|
||||
public function getAkteContent($akte_id)
|
||||
{
|
||||
$akte = $this->ci->AkteModel->load($akte_id);
|
||||
$akte = $this->_ci->AkteModel->load($akte_id);
|
||||
if (hasData($akte))
|
||||
{
|
||||
if ($akte->retval[0]->inhalt != '')
|
||||
if (getData($akte)[0]->inhalt != '')
|
||||
{
|
||||
return success(base64_decode($akte->retval[0]->inhalt));
|
||||
return success(base64_decode(getData($akte)[0]->inhalt));
|
||||
}
|
||||
elseif ($akte->retval[0]->dms_id != '')
|
||||
elseif (getData($akte)[0]->dms_id != '')
|
||||
{
|
||||
$dmscontent = $this->read($akte->retval[0]->dms_id);
|
||||
$dmscontent = $this->read(getData($akte)[0]->dms_id);
|
||||
if (isSuccess($dmscontent))
|
||||
{
|
||||
return success(base64_decode($dmscontent->retval[0]->file_content));
|
||||
return success(base64_decode(getData($dmscontent)[0]->file_content));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -415,10 +905,10 @@ class DmsLib extends FHC_Controller
|
||||
{
|
||||
$filename = uniqid().'.'.pathinfo($dms['name'], PATHINFO_EXTENSION);
|
||||
|
||||
$result = $this->ci->DmsFSModel->write($filename, $dms['file_content']);
|
||||
$result = $this->_ci->DmsFSModel->writeBase64($filename, $dms['file_content']);
|
||||
if (isSuccess($result))
|
||||
{
|
||||
$result->retval = $filename;
|
||||
$result = success($filename);
|
||||
}
|
||||
|
||||
return $result;
|
||||
@@ -439,7 +929,7 @@ class DmsLib extends FHC_Controller
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$result = $this->ci->DmsFSModel->write($result->retval[0]->filename, $dms['file_content']);
|
||||
$result = $this->_ci->DmsFSModel->writeBase64(getData($result)[0]->filename, $dms['file_content']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -451,12 +941,14 @@ class DmsLib extends FHC_Controller
|
||||
*/
|
||||
private function _loadUploadLibrary($allowed_types)
|
||||
{
|
||||
$config['upload_path'] = $this->UPLOAD_PATH;
|
||||
$config['allowed_types'] = implode('|', $allowed_types);
|
||||
$config['overwrite'] = true;
|
||||
$config['file_name'] = uniqid().'.pdf';
|
||||
$config = array();
|
||||
$config['upload_path'] = DMS_PATH;
|
||||
$config['allowed_types'] = implode('|', $allowed_types);
|
||||
$config['overwrite'] = true;
|
||||
$config['file_name'] = uniqid().'.pdf';
|
||||
|
||||
$this->ci->load->library('upload', $config);
|
||||
$this->ci->upload->initialize($config);
|
||||
$this->_ci->load->library('upload', $config);
|
||||
$this->_ci->upload->initialize($config);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
<?php
|
||||
/***
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-API
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2016, fhcomplete.org
|
||||
* @license GPLv3
|
||||
* @link http://fhcomplete.org
|
||||
* @since Version 1.0
|
||||
* @filesource
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class FilesystemLib
|
||||
{
|
||||
/**
|
||||
* checkParameters
|
||||
*/
|
||||
private function checkParameters($filepath, $filename)
|
||||
{
|
||||
if (isset($filepath) && isset($filename) &&
|
||||
$filepath != '' && $filename != '')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* read
|
||||
*/
|
||||
public function read($filepath, $filename)
|
||||
{
|
||||
$result = null;
|
||||
|
||||
if ($this->checkParameters($filepath, $filename))
|
||||
{
|
||||
$resource = $filepath.DIRECTORY_SEPARATOR.$filename;
|
||||
if (file_exists($resource) && $fileHandle = fopen($resource, 'r'))
|
||||
{
|
||||
$result = '';
|
||||
while (!feof($fileHandle))
|
||||
{
|
||||
$result .= fread($fileHandle, 8192);
|
||||
}
|
||||
fclose($fileHandle);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* write
|
||||
*/
|
||||
public function write($filepath, $filename, $content)
|
||||
{
|
||||
$result = null;
|
||||
|
||||
if ($this->checkParameters($filepath, $filename) && isset($content))
|
||||
{
|
||||
$resource = $filepath.DIRECTORY_SEPARATOR.$filename;
|
||||
if (is_writable($filepath) && $fileHandle = fopen($resource, 'w'))
|
||||
{
|
||||
if (fwrite($fileHandle, $content) !== false)
|
||||
{
|
||||
$result = true;
|
||||
}
|
||||
fclose($fileHandle);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* append
|
||||
*/
|
||||
public function append($filepath, $filename, $content)
|
||||
{
|
||||
$result = null;
|
||||
|
||||
if ($this->checkParameters($filepath, $filename) && isset($content))
|
||||
{
|
||||
$resource = $filepath.DIRECTORY_SEPARATOR.$filename;
|
||||
if (is_writable($resource) && $fileHandle = fopen($resource, 'a'))
|
||||
{
|
||||
if (fwrite($fileHandle, $content) !== false)
|
||||
{
|
||||
$result = true;
|
||||
}
|
||||
fclose($fileHandle);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* remove
|
||||
*/
|
||||
public function remove($filepath, $filename)
|
||||
{
|
||||
$result = null;
|
||||
|
||||
if ($this->checkParameters($filepath, $filename))
|
||||
{
|
||||
if (is_writable($filepath))
|
||||
{
|
||||
$resource = $filepath.DIRECTORY_SEPARATOR.$filename;
|
||||
$result = unlink($resource);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* rename
|
||||
*/
|
||||
public function rename($filepath, $filename, $newFilepath, $newFilename)
|
||||
{
|
||||
$result = null;
|
||||
|
||||
if ($this->checkParameters($filepath, $filename) && $this->checkParameters($newFilepath, $newFilename))
|
||||
{
|
||||
$resource = $filepath.DIRECTORY_SEPARATOR.$filename;
|
||||
if (is_writable($filepath) && is_writable($newFilepath) && file_exists($resource))
|
||||
{
|
||||
$destination = $newFilepath.DIRECTORY_SEPARATOR.$newFilename;
|
||||
$result = rename($resource, $destination);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -62,17 +62,17 @@ class IssuesLib
|
||||
* @param array $fehlertext_params params for sprint replace of error text in system.tbl_fehler
|
||||
* @return object success or error
|
||||
*/
|
||||
public function addFhcIssue($fehler_kurzbz, $person_id = null, $oe_kurzbz = null, $fehlertext_params = null)
|
||||
public function addFhcIssue($fehler_kurzbz, $person_id = null, $oe_kurzbz = null, $fehlertext_params = null, $resolution_params = null)
|
||||
{
|
||||
$fehlerRes = $this->_ci->FehlerModel->loadWhere(array('fehler_kurzbz' => $fehler_kurzbz));
|
||||
|
||||
if (hasData($fehlerRes))
|
||||
{
|
||||
$fehlercode = getData($fehlerRes)[0]->fehlercode;
|
||||
return $this->_addIssue($fehlercode, $person_id, $oe_kurzbz, $fehlertext_params);
|
||||
return $this->_addIssue($fehlercode, $person_id, $oe_kurzbz, $fehlertext_params, $resolution_params);
|
||||
}
|
||||
else
|
||||
return error("Fehler $fehler_kurzbz nicht gefunden");
|
||||
return error("Error $fehler_kurzbz not found");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,13 +82,13 @@ class IssuesLib
|
||||
* @param int $person_id
|
||||
* @param int $oe_kurzbz
|
||||
* @param array $fehlertext_params params for replacement of parts of error text
|
||||
* @param bool $force_predefined if true, only predefined external issues are added
|
||||
* @param bool $force_predefined if true, only predefined (with entry in fehler table) external issues are added
|
||||
* @return object success or error
|
||||
*/
|
||||
public function addExternalIssue($fehlercode_extern, $inhalt_extern, $person_id = null, $oe_kurzbz = null, $fehlertext_params = null, $force_predefined = false)
|
||||
public function addExternalIssue($fehlercode_extern, $inhalt_extern, $person_id = null, $oe_kurzbz = null, $fehlertext_params = null)
|
||||
{
|
||||
if (isEmptyString($fehlercode_extern))
|
||||
return error("fehlercode_extern fehlt");
|
||||
return error("fehlercode_extern missing");
|
||||
|
||||
// get external fehlercode (unique for each app)
|
||||
$this->_ci->FehlerModel->addSelect('fehlercode');
|
||||
@@ -102,19 +102,13 @@ class IssuesLib
|
||||
if (isError($fehlerRes))
|
||||
return $fehlerRes;
|
||||
|
||||
$fehlerData = getData($fehlerRes)[0];
|
||||
|
||||
// check if there is a predefined custom error for the external issue
|
||||
if (hasData($fehlerRes))
|
||||
{
|
||||
$fehlerData = getData($fehlerRes)[0];
|
||||
// if found, use the code
|
||||
$fehlercode = $fehlerData->fehlercode;
|
||||
}
|
||||
elseif ($force_predefined === true)
|
||||
{
|
||||
// only added if predefined
|
||||
return success("No definition found - not added");
|
||||
}
|
||||
else
|
||||
{
|
||||
// if predefined error is not found, insert with fallback code
|
||||
@@ -122,20 +116,70 @@ class IssuesLib
|
||||
}
|
||||
|
||||
// add external issue
|
||||
return $this->_addIssue($fehlercode, $person_id, $oe_kurzbz, $fehlertext_params, $fehlercode_extern, $inhalt_extern);
|
||||
return $this->_addIssue($fehlercode, $person_id, $oe_kurzbz, $fehlertext_params, null, $fehlercode_extern, $inhalt_extern);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set issue to resolved.
|
||||
* @param int $issue_id
|
||||
* @param string $user uid of issue resolver
|
||||
* @return object success or error
|
||||
*/
|
||||
public function setBehoben($issue_id, $user)
|
||||
{
|
||||
$data = array(
|
||||
'status_kurzbz' => self::STATUS_BEHOBEN,
|
||||
'verarbeitetvon' => $user,
|
||||
'verarbeitetamum' => date('Y-m-d H:i:s')
|
||||
);
|
||||
|
||||
return $this->_changeIssueStatus($issue_id, $data, $user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set issue to in progress.
|
||||
* @param int $issue_id
|
||||
* @param string $user uid of issue resovler
|
||||
* @return object success or error
|
||||
*/
|
||||
public function setInBearbeitung($issue_id, $user)
|
||||
{
|
||||
$data = array(
|
||||
'status_kurzbz' => self::STATUS_IN_BEARBEITUNG,
|
||||
'verarbeitetvon' => $user
|
||||
);
|
||||
|
||||
return $this->_changeIssueStatus($issue_id, $data, $user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set issue to new.
|
||||
* @param int $issue_id
|
||||
* @param string $user uid of issue resolver
|
||||
* @return object success or error
|
||||
*/
|
||||
public function setNeu($issue_id, $user)
|
||||
{
|
||||
$data = array(
|
||||
'status_kurzbz' => self::STATUS_NEU,
|
||||
'verarbeitetvon' => null,
|
||||
'verarbeitetamum' => null
|
||||
);
|
||||
|
||||
return $this->_changeIssueStatus($issue_id, $data, $user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes status of an issue.
|
||||
* @param int $issue_id
|
||||
* @param string $status_kurzbz the new status
|
||||
* @param string $verarbeitetvon uid of person changing the status (needed for in Bearbeitung and behoben)
|
||||
* @param array $sdata the data to save, including status
|
||||
* @param string $user uid of person changing the status (needed for in Bearbeitung and behoben)
|
||||
* @return success or error
|
||||
*/
|
||||
public function changeIssueStatus($issue_id, $status_kurzbz, $verarbeitetvon = null)
|
||||
private function _changeIssueStatus($issue_id, $data, $user)
|
||||
{
|
||||
if (!isset($issue_id) || !is_numeric($issue_id))
|
||||
return error("Issue Id muss korrekt gesetzt sein.");
|
||||
return error("Issue Id must be set correctly.");
|
||||
|
||||
// check if given status is same as existing
|
||||
$this->_ci->IssueModel->addSelect('status_kurzbz');
|
||||
@@ -143,39 +187,14 @@ class IssuesLib
|
||||
|
||||
if (hasData($currStatus))
|
||||
{
|
||||
if (getData($currStatus)[0]->status_kurzbz == $status_kurzbz)
|
||||
return success("Gleicher Status bereits gesetzt");
|
||||
if (getData($currStatus)[0]->status_kurzbz == $data['status_kurzbz'])
|
||||
return success("Same status already set");
|
||||
}
|
||||
else
|
||||
return error("Fehler beim Holen des Status");
|
||||
return error("Error when getting status");
|
||||
|
||||
$data = array(
|
||||
'status_kurzbz' => $status_kurzbz,
|
||||
'updatevon' => $verarbeitetvon,
|
||||
'updateamum' => date('Y-m-d H:i:s')
|
||||
);
|
||||
|
||||
if ($status_kurzbz == self::STATUS_NEU)
|
||||
{
|
||||
|
||||
$data['verarbeitetvon'] = null;
|
||||
}
|
||||
|
||||
if ($status_kurzbz == self::STATUS_NEU || $status_kurzbz == self::STATUS_IN_BEARBEITUNG)
|
||||
{
|
||||
$data['verarbeitetamum'] = null;
|
||||
}
|
||||
|
||||
if ($status_kurzbz == self::STATUS_IN_BEARBEITUNG || $status_kurzbz == self::STATUS_BEHOBEN)
|
||||
{
|
||||
if (isset($verarbeitetvon))
|
||||
$data['verarbeitetvon'] = $verarbeitetvon;
|
||||
else
|
||||
return error("Verarbeitetvon nicht gesetzt");
|
||||
}
|
||||
|
||||
if ($status_kurzbz == self::STATUS_BEHOBEN)
|
||||
$data['verarbeitetamum'] = date('Y-m-d H:i:s');
|
||||
$data['updatevon'] = $user;
|
||||
$data['updateamum'] = date('Y-m-d H:i:s');
|
||||
|
||||
return $this->_ci->IssueModel->update(
|
||||
array(
|
||||
@@ -191,14 +210,15 @@ class IssuesLib
|
||||
* @param int $person_id
|
||||
* @param string $oe_kurzbz
|
||||
* @param array $fehlertext_params
|
||||
* @param string $resolution_params
|
||||
* @param string $fehlercode_extern
|
||||
* @param string $inhalt_extern
|
||||
* @return object success or error
|
||||
*/
|
||||
private function _addIssue($fehlercode, $person_id = null, $oe_kurzbz = null, $fehlertext_params = null, $fehlercode_extern = null, $inhalt_extern = null)
|
||||
private function _addIssue($fehlercode, $person_id = null, $oe_kurzbz = null, $fehlertext_params = null, $resolution_params = null, $fehlercode_extern = null, $inhalt_extern = null)
|
||||
{
|
||||
if (isEmptyString($person_id) && isEmptyString($oe_kurzbz))
|
||||
return error("Person_id oder oe_kurzbz muss gesetzt sein.");
|
||||
return error("Person_id or oe_kurzbz must be set.");
|
||||
|
||||
// get fehlertextVorlage and replace it with params
|
||||
$fehlerRes = $this->_ci->FehlerModel->load($fehlercode);
|
||||
@@ -218,6 +238,20 @@ class IssuesLib
|
||||
|
||||
if ($openIssueCount == 0)
|
||||
{
|
||||
if (isset($resolution_params))
|
||||
{
|
||||
if (is_array($resolution_params))
|
||||
{
|
||||
foreach ($resolution_params as $resolution_key => $resolution_param)
|
||||
{
|
||||
if (!is_string($resolution_key))
|
||||
return error("Invalid parameter for resolution, must be an associative array");
|
||||
}
|
||||
}
|
||||
else
|
||||
return error("Invalid parameters for resolution");
|
||||
}
|
||||
|
||||
return $this->_ci->IssueModel->insert(
|
||||
array(
|
||||
'fehlercode' => $fehlercode,
|
||||
@@ -228,6 +262,7 @@ class IssuesLib
|
||||
'oe_kurzbz' => $oe_kurzbz,
|
||||
'datum' => date('Y-m-d H:i:s'),
|
||||
'status_kurzbz' => self::STATUS_NEU,
|
||||
'behebung_parameter' => isset($resolution_params) ? json_encode($resolution_params) : null,
|
||||
'insertvon' => $this->_insertvon
|
||||
)
|
||||
);
|
||||
@@ -236,9 +271,9 @@ class IssuesLib
|
||||
return success($openIssueCount);
|
||||
}
|
||||
else
|
||||
return error("Anzahl offener Issues konnte nicht ermittelt werden.");
|
||||
return error("Number of open issues could not be determined");
|
||||
}
|
||||
else
|
||||
return error("Fehler $fehlercode nicht gefunden");
|
||||
return error("Error $fehlercode could not be found");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ class VorlageLib
|
||||
if (!hasData($vorlage))
|
||||
{
|
||||
// Builds where clause
|
||||
$where = $this->_where($vorlage_kurzbz, $orgform_kurzbz, $sprache);
|
||||
$where = $this->_where($vorlage_kurzbz);
|
||||
|
||||
$vorlage = $this->ci->organisationseinheitlib->treeSearch(
|
||||
'public',
|
||||
@@ -134,20 +134,11 @@ class VorlageLib
|
||||
/**
|
||||
* _where
|
||||
*/
|
||||
private function _where($vorlage_kurzbz, $orgform_kurzbz, $sprache)
|
||||
private function _where($vorlage_kurzbz)
|
||||
{
|
||||
// Builds where clause
|
||||
$where = "vorlage_kurzbz = ".$this->ci->VorlageModel->escape($vorlage_kurzbz);
|
||||
|
||||
if (is_null($sprache))
|
||||
{
|
||||
$where .= " AND sprache IS NULL";
|
||||
}
|
||||
else
|
||||
{
|
||||
$where .= " AND sprache = ".$this->ci->VorlageModel->escape($sprache);
|
||||
}
|
||||
|
||||
$where .= " AND aktiv = true";
|
||||
|
||||
return $where;
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Bisio Zweck does not exist
|
||||
*/
|
||||
class CORE_INOUT_0001 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['bisio_id']) || !is_numeric($params['bisio_id']))
|
||||
return error('Bisio Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->model('codex/Bisiozweck_model', 'BisiozweckModel');
|
||||
|
||||
// get all bisio Zwecke
|
||||
$this->_ci->BisiozweckModel->addSelect('1');
|
||||
$bisiozweckRes = $this->_ci->BisiozweckModel->loadWhere(array('bisio_id' => $params['bisio_id']));
|
||||
|
||||
if (isError($bisiozweckRes))
|
||||
return $bisiozweckRes;
|
||||
|
||||
if (hasData($bisiozweckRes))
|
||||
return success(true); // resolved if bisio Zweck exists
|
||||
else
|
||||
return success(false); // not resolved if no bisio zweck
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* More than one Zweck for incoming
|
||||
*/
|
||||
class CORE_INOUT_0002 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['bisio_id']) || !is_numeric($params['bisio_id']))
|
||||
return error('Bisio Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->model('codex/Bisiozweck_model', 'BisiozweckModel');
|
||||
|
||||
// get all bisio Zwecke
|
||||
$this->_ci->BisiozweckModel->addSelect('1');
|
||||
$bisiozweckRes = $this->_ci->BisiozweckModel->loadWhere(array('bisio_id' => $params['bisio_id']));
|
||||
|
||||
if (isError($bisiozweckRes))
|
||||
return $bisiozweckRes;
|
||||
|
||||
if (hasData($bisiozweckRes))
|
||||
{
|
||||
if (count(getData($bisiozweckRes)) <= 1) // resolved if one bisio Zweck
|
||||
return success(true);
|
||||
else
|
||||
return success(false); // otherwise not resolved
|
||||
}
|
||||
else
|
||||
return success(true); // resolved if no bisio zweck
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Invalid Zweck for incoming
|
||||
*/
|
||||
class CORE_INOUT_0003 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['bisio_id']) || !is_numeric($params['bisio_id']))
|
||||
return error('Bisio Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->model('codex/Bisiozweck_model', 'BisiozweckModel');
|
||||
|
||||
// get all Zwecke
|
||||
$this->_ci->BisiozweckModel->addSelect('zweck_code');
|
||||
$bisiozweckRes = $this->_ci->BisiozweckModel->loadWhere(array('bisio_id' => $params['bisio_id']));
|
||||
|
||||
if (isError($bisiozweckRes))
|
||||
return $bisiozweckRes;
|
||||
|
||||
if (hasData($bisiozweckRes))
|
||||
{
|
||||
$bisiozweckData = getData($bisiozweckRes);
|
||||
|
||||
// resolved if Zweck is 1, 2 or 3
|
||||
if (count($bisiozweckData) == 1 && !in_array($bisiozweckData[0]->zweck_code, array(1, 2, 3)))
|
||||
return success(false);
|
||||
else
|
||||
return success(true);
|
||||
}
|
||||
else
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Aufenthaltsförderung must exist if certain length of outgoing stay is exceeded
|
||||
*/
|
||||
class CORE_INOUT_0004 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['bisio_id']) || !is_numeric($params['bisio_id']))
|
||||
return error('Bisio Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->model('codex/Aufenthaltfoerderung_model', 'AufenthaltfoerderungModel');
|
||||
|
||||
// get all Zwecke
|
||||
$this->_ci->AufenthaltfoerderungModel->addSelect('tbl_aufenthaltfoerderung.aufenthaltfoerderung_code');
|
||||
$this->_ci->AufenthaltfoerderungModel->addJoin('bis.tbl_bisio_aufenthaltfoerderung', 'aufenthaltfoerderung_code');
|
||||
$this->_ci->AufenthaltfoerderungModel->addOrder('tbl_aufenthaltfoerderung.aufenthaltfoerderung_code');
|
||||
$bisioFoerderungRes = $this->_ci->AufenthaltfoerderungModel->loadWhere(array('bisio_id' => $params['bisio_id']));
|
||||
|
||||
if (isError($bisioFoerderungRes))
|
||||
return $bisioFoerderungRes;
|
||||
|
||||
if (hasData($bisioFoerderungRes))
|
||||
{
|
||||
// resolved if Aufenthaltsfoerderung exists
|
||||
return success(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_ci->load->model('codex/Bisio_model', 'BisioModel');
|
||||
|
||||
// get Bisio Aufenthaltsdauer
|
||||
$aufenthaltsdauerRes = $this->_ci->BisioModel->getAufenthaltsdauer($params['bisio_id']);
|
||||
|
||||
if (isError($aufenthaltsdauerRes))
|
||||
return $aufenthaltsdauerRes;
|
||||
|
||||
if (hasData($aufenthaltsdauerRes))
|
||||
{
|
||||
$aufenthaltsdauer = getData($aufenthaltsdauerRes);
|
||||
|
||||
// check if stay >= 29 days. If yes and no Aufenthaltsfoerderung - not resolved
|
||||
if ($aufenthaltsdauer >= 29)
|
||||
return success(false);
|
||||
else
|
||||
return success(true);
|
||||
}
|
||||
else // no Aufenthaltsdauer - not resolved
|
||||
return success(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* ECTS angerechnet must exist for outgoing if longer stay
|
||||
*/
|
||||
class CORE_INOUT_0005 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['bisio_id']) || !is_numeric($params['bisio_id']))
|
||||
return error('Bisio Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->model('codex/Bisio_model', 'BisioModel');
|
||||
|
||||
// get all Zwecke
|
||||
$this->_ci->BisioModel->addSelect('ects_angerechnet');
|
||||
$bisioRes = $this->_ci->BisioModel->loadWhere(array('bisio_id' => $params['bisio_id']));
|
||||
|
||||
if (isError($bisioRes))
|
||||
return $bisioRes;
|
||||
|
||||
if (hasData($bisioRes) && !isEmptyString(getData($bisioRes)[0]->ects_angerechnet))
|
||||
{
|
||||
// resolved if ects exists
|
||||
return success(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// get Bisio Aufenthaltsdauer
|
||||
$aufenthaltsdauerRes = $this->_ci->BisioModel->getAufenthaltsdauer($params['bisio_id']);
|
||||
|
||||
if (isError($aufenthaltsdauerRes))
|
||||
return $aufenthaltsdauerRes;
|
||||
|
||||
if (hasData($aufenthaltsdauerRes))
|
||||
{
|
||||
$aufenthaltsdauer = getData($aufenthaltsdauerRes);
|
||||
|
||||
// check if stay >= 29 days. If yes and no ects - not resolved
|
||||
if ($aufenthaltsdauer >= 29)
|
||||
return success(false);
|
||||
else
|
||||
return success(true);
|
||||
}
|
||||
else // no Aufenthaltsdauer - not resolved
|
||||
return success(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* ECTS erworben must exist for outgoing if longer stay
|
||||
*/
|
||||
class CORE_INOUT_0006 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['bisio_id']) || !is_numeric($params['bisio_id']))
|
||||
return error('Bisio Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->model('codex/Bisio_model', 'BisioModel');
|
||||
//$this->_ci->load->model('codex/Aufenthaltfoerderung_model', 'AufenthaltfoerderungModel');
|
||||
|
||||
// get all Zwecke
|
||||
$this->_ci->BisioModel->addSelect('ects_erworben');
|
||||
$bisioRes = $this->_ci->BisioModel->loadWhere(array('bisio_id' => $params['bisio_id']));
|
||||
|
||||
if (isError($bisioRes))
|
||||
return $bisioRes;
|
||||
|
||||
if (hasData($bisioRes) && !isEmptyString(getData($bisioRes)[0]->ects_erworben))
|
||||
{
|
||||
// resolved if ects exists
|
||||
return success(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// get Bisio Aufenthaltsdauer
|
||||
$aufenthaltsdauerRes = $this->_ci->BisioModel->getAufenthaltsdauer($params['bisio_id']);
|
||||
|
||||
if (isError($aufenthaltsdauerRes))
|
||||
return $aufenthaltsdauerRes;
|
||||
|
||||
if (hasData($aufenthaltsdauerRes))
|
||||
{
|
||||
$aufenthaltsdauer = getData($aufenthaltsdauerRes);
|
||||
|
||||
// check if stay >= 29 days. If yes and no ects - not resolved
|
||||
if ($aufenthaltsdauer >= 29)
|
||||
return success(false);
|
||||
else
|
||||
return success(true);
|
||||
}
|
||||
else // no Aufenthaltsdauer - not resolved
|
||||
return success(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* ZGV Datum in future
|
||||
*/
|
||||
class CORE_ZGV_0001 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
// get zgvdatum of prestudent
|
||||
$this->_ci->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$this->_ci->PrestudentModel->addSelect('zgvdatum');
|
||||
$prestudentRes = $this->_ci->PrestudentModel->load($params['prestudent_id']);
|
||||
|
||||
if (isError($prestudentRes))
|
||||
return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$zgvdatum = getData($prestudentRes)[0]->zgvdatum;
|
||||
|
||||
if (isEmptyString($zgvdatum))
|
||||
return success(false);
|
||||
|
||||
// check if zgvdatum comes after today
|
||||
if ($zgvdatum > date('Y-m-d'))
|
||||
return success(false);
|
||||
else
|
||||
return success(true);
|
||||
}
|
||||
else
|
||||
return success(false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* ZGV Datum must be after Geburtsdatum
|
||||
*/
|
||||
class CORE_ZGV_0002 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
// get zgvdatum of prestudent
|
||||
$this->_ci->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$this->_ci->PrestudentModel->addSelect('zgvdatum, gebdatum');
|
||||
$this->_ci->PrestudentModel->addJoin('public.tbl_person', 'person_id');
|
||||
$prestudentRes = $this->_ci->PrestudentModel->load($params['prestudent_id']);
|
||||
|
||||
if (isError($prestudentRes))
|
||||
return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudentData = getData($prestudentRes)[0];
|
||||
|
||||
$zgvdatum = $prestudentData->zgvdatum;
|
||||
|
||||
if (isEmptyString($zgvdatum))
|
||||
return success(false);
|
||||
|
||||
$gebdatum = $prestudentData->gebdatum;
|
||||
|
||||
if (isEmptyString($gebdatum))
|
||||
return success(false);
|
||||
|
||||
// check if zgvdatum comes before geburtsdatum
|
||||
if ($zgvdatum < $gebdatum)
|
||||
return success(false);
|
||||
else
|
||||
return success(true);
|
||||
}
|
||||
else
|
||||
return success(false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* ZGV master Datum in future
|
||||
*/
|
||||
class CORE_ZGV_0003 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
// get zgvdatum of prestudent
|
||||
$this->_ci->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$this->_ci->PrestudentModel->addSelect('zgvmadatum');
|
||||
$prestudentRes = $this->_ci->PrestudentModel->load($params['prestudent_id']);
|
||||
|
||||
if (isError($prestudentRes))
|
||||
return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$zgvdatum = getData($prestudentRes)[0]->zgvmadatum;
|
||||
|
||||
if (isEmptyString($zgvdatum))
|
||||
return success(false);
|
||||
|
||||
// check if zgvdatum comes after today
|
||||
if ($zgvdatum > date('Y-m-d'))
|
||||
return success(false);
|
||||
else
|
||||
return success(true);
|
||||
}
|
||||
else
|
||||
return success(false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* ZGV Datum should not be after ZGV master Datum
|
||||
*/
|
||||
class CORE_ZGV_0004 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
// get zgvdatum of prestudent
|
||||
$this->_ci->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$this->_ci->PrestudentModel->addSelect('zgvdatum, zgvmadatum');
|
||||
$prestudentRes = $this->_ci->PrestudentModel->load($params['prestudent_id']);
|
||||
|
||||
if (isError($prestudentRes))
|
||||
return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudentData = getData($prestudentRes)[0];
|
||||
|
||||
// get and compare zgvdatum and zgvmadatum
|
||||
$zgvdatum = $prestudentData->zgvdatum;
|
||||
|
||||
if (isEmptyString($zgvdatum))
|
||||
return success(false);
|
||||
|
||||
$zgvmadatum = $prestudentData->zgvmadatum;
|
||||
|
||||
if (isEmptyString($zgvmadatum))
|
||||
return success(false);
|
||||
|
||||
// check if zgvmadatum comes after zgvdatum
|
||||
if ($zgvmadatum < $zgvdatum)
|
||||
return success(false);
|
||||
else
|
||||
return success(true);
|
||||
}
|
||||
else
|
||||
return success(false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* ZGV master Datum before Geburtsdatum
|
||||
*/
|
||||
class CORE_ZGV_0005 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
// get zgvdatum and geburtsdatum of prestudent
|
||||
$this->_ci->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$this->_ci->PrestudentModel->addSelect('zgvmadatum, gebdatum');
|
||||
$this->_ci->PrestudentModel->addJoin('public.tbl_person', 'person_id');
|
||||
$prestudentRes = $this->_ci->PrestudentModel->load($params['prestudent_id']);
|
||||
|
||||
if (isError($prestudentRes))
|
||||
return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudentData = getData($prestudentRes)[0];
|
||||
|
||||
$zgvdatum = $prestudentData->zgvmadatum;
|
||||
|
||||
if (isEmptyString($zgvdatum))
|
||||
return success(false);
|
||||
|
||||
$gebdatum = $prestudentData->gebdatum;
|
||||
|
||||
if (isEmptyString($gebdatum))
|
||||
return success(false);
|
||||
|
||||
// check if zgvdatum comes before geburtsdatum
|
||||
if ($zgvdatum < $gebdatum)
|
||||
return success(false);
|
||||
else
|
||||
return success(true);
|
||||
}
|
||||
else
|
||||
return success(false);
|
||||
}
|
||||
}
|
||||
@@ -135,7 +135,7 @@ class Vertragvertragsstatus_model extends DB_Model
|
||||
|
||||
/**
|
||||
* Get all contracts, where the status had been set to 'bestellt' on given date
|
||||
* @param string $string_date e.g. '01.11.2019' or special Date/Time inputs like 'YESTERDAY', 'TODAY', 'NOW'
|
||||
* @param string $string_date e.g. 'YYYY-MM-DD' or special Date/Time inputs like 'YESTERDAY', 'TODAY', 'NOW'
|
||||
* @param bool $further_processed If true, ALL ordered contracts of that day are retrieved, even if they were
|
||||
* were ALSO approved/accepted/cancelled (further processed) on that same day.
|
||||
* @return array
|
||||
|
||||
@@ -11,4 +11,37 @@ class Bisio_model extends DB_Model
|
||||
$this->dbTable = 'bis.tbl_bisio';
|
||||
$this->pk = 'bisio_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets duration of stay in days by bisio_id.
|
||||
* @param int $bisio_id
|
||||
* @return object success with number of days or error
|
||||
*/
|
||||
public function getAufenthaltsdauer($bisio_id)
|
||||
{
|
||||
// get from and to date
|
||||
$this->addSelect('von, bis');
|
||||
$bisioRes = $this->load($bisio_id);
|
||||
|
||||
if (isError($bisioRes))
|
||||
return $bisioRes;
|
||||
|
||||
if (hasData($bisioRes))
|
||||
{
|
||||
$bisioData = getData($bisioRes)[0];
|
||||
|
||||
$avon = $bisioData->von;
|
||||
$abis = $bisioData->bis;
|
||||
|
||||
if (is_null($avon) || is_null($abis))
|
||||
return success("Von or bis date not set");
|
||||
|
||||
$vonDate = new DateTime($avon);
|
||||
$bisDate = new DateTime($abis);
|
||||
$interval = $vonDate->diff($bisDate);
|
||||
return success($interval->days);
|
||||
}
|
||||
else
|
||||
return success("Bisio not found");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ class DmsFS_model extends FS_Model
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->filepath = DMS_PATH;
|
||||
parent::__construct(DMS_PATH);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Model for writing temporary files
|
||||
*/
|
||||
class TempFS_model extends FS_Model
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// default temp directory of server is used
|
||||
parent::__construct(sys_get_temp_dir());
|
||||
}
|
||||
}
|
||||
@@ -18,45 +18,50 @@ class Konto_model extends DB_Model
|
||||
public function setPaid($buchungsnr)
|
||||
{
|
||||
// get payment
|
||||
$buchungResult = $this->loadWhere(array('buchungsnr' => $buchungsnr));
|
||||
$buchungResult = $this->loadWhere(array('buchungsnr' => $buchungsnr));
|
||||
|
||||
if(isSuccess($buchungResult) && hasData($buchungResult))
|
||||
if (isSuccess($buchungResult) && hasData($buchungResult))
|
||||
{
|
||||
$buchung = getData($buchungResult)[0];
|
||||
|
||||
// get already paid amount
|
||||
$this->addSelect('sum(betrag) as bezahlt');
|
||||
$this->addGroupBy('buchungsnr_verweis');
|
||||
$buchungVerweisResult = $this->loadWhere(array('buchungsnr_verweis' => $buchungsnr));
|
||||
$buchungVerweisResult = $this->loadWhere(array('buchungsnr_verweis' => $buchungsnr));
|
||||
|
||||
if(isSuccess($buchungVerweisResult))
|
||||
if (isSuccess($buchungVerweisResult))
|
||||
{
|
||||
if(hasData($buchungVerweisResult))
|
||||
{
|
||||
$betragBezahltResult = getData($buchungVerweisResult);
|
||||
$betragBezahlt = $betragBezahltResult->bezahlt;
|
||||
}
|
||||
else
|
||||
$betragBezahlt = 0;
|
||||
$betragBezahlt = 0;
|
||||
|
||||
$buchung = getData($buchungResult);
|
||||
$buchung = $buchung[0];
|
||||
if (hasData($buchungVerweisResult))
|
||||
{
|
||||
$betragBezahlt = getData($buchungVerweisResult)[0]->bezahlt;
|
||||
}
|
||||
|
||||
// calculate open amount
|
||||
$betragOffen = $betragBezahlt - $buchung->betrag*(-1);
|
||||
$betragOffen = $betragBezahlt - $buchung->betrag * (-1);
|
||||
|
||||
$data = array(
|
||||
'person_id' => $buchung->person_id,
|
||||
'studiengang_kz' => $buchung->studiengang_kz,
|
||||
'studiensemester_kurzbz' => $buchung->studiensemester_kurzbz,
|
||||
'buchungsnr_verweis' => $buchungsnr,
|
||||
'betrag' => str_replace(',','.',$betragOffen*(-1)),
|
||||
'buchungsdatum' => date('Y-m-d'),
|
||||
'buchungstext' => $buchung->buchungstext,
|
||||
'insertamum' => date('Y-m-d H:i:s'),
|
||||
'insertvon' => '',
|
||||
'buchungstyp_kurzbz' => $buchung->buchungstyp_kurzbz,
|
||||
);
|
||||
if ($betragOffen != 0)
|
||||
{
|
||||
$data = array(
|
||||
'person_id' => $buchung->person_id,
|
||||
'studiengang_kz' => $buchung->studiengang_kz,
|
||||
'studiensemester_kurzbz' => $buchung->studiensemester_kurzbz,
|
||||
'buchungsnr_verweis' => $buchungsnr,
|
||||
'betrag' => str_replace(',', '.', $betragOffen * (-1)),
|
||||
'buchungsdatum' => date('Y-m-d'),
|
||||
'buchungstext' => $buchung->buchungstext,
|
||||
'insertamum' => date('Y-m-d H:i:s'),
|
||||
'insertvon' => '',
|
||||
'buchungstyp_kurzbz' => $buchung->buchungstyp_kurzbz,
|
||||
);
|
||||
|
||||
return $this->insert($data);
|
||||
return $this->insert($data);
|
||||
}
|
||||
else
|
||||
{
|
||||
return success();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -68,4 +73,54 @@ class Konto_model extends DB_Model
|
||||
return error('Failed to load Payment');
|
||||
}
|
||||
}
|
||||
|
||||
public function getStudienbeitraege($uid, $buchungstypen)
|
||||
{
|
||||
$query = 'SELECT konto.studiensemester_kurzbz
|
||||
FROM public.tbl_konto konto
|
||||
JOIN public.tbl_studiensemester studiensemester ON konto.studiensemester_kurzbz = studiensemester.studiensemester_kurzbz,
|
||||
public.tbl_benutzer,
|
||||
public.tbl_student
|
||||
WHERE tbl_benutzer.uid = \'' . $uid . '\'
|
||||
AND tbl_benutzer.uid = tbl_student.student_uid
|
||||
AND tbl_benutzer.person_id = konto.person_id
|
||||
AND konto.studiengang_kz = tbl_student.studiengang_kz
|
||||
AND konto.buchungstyp_kurzbz IN (\'' . $buchungstypen . '\')
|
||||
AND 0 = (
|
||||
SELECT sum(betrag)
|
||||
FROM public.tbl_konto skonto
|
||||
WHERE skonto.buchungsnr = konto.buchungsnr_verweis
|
||||
OR skonto.buchungsnr_verweis = konto.buchungsnr_verweis
|
||||
)
|
||||
ORDER BY studiensemester.start DESC;
|
||||
';
|
||||
|
||||
return $this->execQuery($query);
|
||||
}
|
||||
|
||||
public function checkStudienbeitrag($uid, $stsem, $buchungstypen)
|
||||
{
|
||||
$query = 'SELECT tbl_konto.buchungsnr,
|
||||
tbl_konto.buchungsdatum
|
||||
FROM public.tbl_konto,
|
||||
public.tbl_benutzer,
|
||||
public.tbl_student
|
||||
WHERE
|
||||
tbl_konto.studiensemester_kurzbz = \'' . $stsem . '\'
|
||||
AND tbl_benutzer.uid = \'' . $uid . '\'
|
||||
AND tbl_benutzer.uid = tbl_student.student_uid
|
||||
AND tbl_benutzer.person_id = tbl_konto.person_id
|
||||
AND tbl_konto.studiengang_kz=tbl_student.studiengang_kz
|
||||
AND tbl_konto.buchungstyp_kurzbz IN (\'' . $buchungstypen . '\')
|
||||
AND 0 >= (
|
||||
SELECT sum(betrag)
|
||||
FROM public.tbl_konto skonto
|
||||
WHERE skonto.buchungsnr = tbl_konto.buchungsnr_verweis
|
||||
OR skonto.buchungsnr_verweis = tbl_konto.buchungsnr_verweis
|
||||
)
|
||||
ORDER BY buchungsnr DESC LIMIT 1
|
||||
';
|
||||
|
||||
return $this->execQuery($query);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -560,7 +560,7 @@ class Prestudent_model extends DB_Model
|
||||
o.bezeichnung,
|
||||
(CASE
|
||||
WHEN sg.typ = \'b\' THEN ps.prestudent_id
|
||||
WHEN sg.typ = \'m\' THEN p.prestudent_id
|
||||
WHEN sg.typ = \'m\' THEN ps.prestudent_id
|
||||
ELSE NULL
|
||||
END) AS prestudent_id
|
||||
FROM public.tbl_prestudent p
|
||||
@@ -581,7 +581,7 @@ class Prestudent_model extends DB_Model
|
||||
|
||||
return $this->execQuery($query, array($person_id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get latest ZGV Bezeichnung of Prestudent.
|
||||
*
|
||||
@@ -593,19 +593,19 @@ class Prestudent_model extends DB_Model
|
||||
{
|
||||
show_error('Prestudent_id is not numeric.');
|
||||
}
|
||||
|
||||
|
||||
$language_index = getUserLanguage() == 'German' ? 0 : 1;
|
||||
|
||||
|
||||
$this->addSelect('
|
||||
COALESCE(
|
||||
array_to_json(zgvmaster.bezeichnung::varchar[])->>' . $language_index . ',
|
||||
array_to_json(zgv.bezeichnung::varchar[])->>' . $language_index . '
|
||||
) AS bezeichnung'
|
||||
);
|
||||
|
||||
|
||||
$this->addJoin('bis.tbl_zgv zgv', 'zgv_code', 'LEFT');
|
||||
$this->addJoin('bis.tbl_zgvmaster zgvmaster', 'zgvmas_code', 'LEFT');
|
||||
|
||||
|
||||
return $this->loadWhere(array(
|
||||
'prestudent_id' => $prestudent_id
|
||||
));
|
||||
@@ -618,8 +618,9 @@ class Prestudent_model extends DB_Model
|
||||
JOIN public.tbl_prestudent ps USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang sg USING(studiengang_kz)
|
||||
JOIN lehre.tbl_studienplan sp USING(studienplan_id)
|
||||
JOIN lehre.tbl_studienordnung so USING(studienordnung_id)
|
||||
WHERE ps.person_id = ?
|
||||
AND UPPER((sg.typ || sg.kurzbz) || ':' || sp.orgform_kurzbz) = ?
|
||||
AND UPPER(so.studiengangkurzbzlang || ':' || sp.orgform_kurzbz) = ?
|
||||
AND pss.studiensemester_kurzbz = ?
|
||||
AND";
|
||||
|
||||
@@ -629,7 +630,7 @@ class Prestudent_model extends DB_Model
|
||||
$query .= " NOT EXISTS";
|
||||
|
||||
$query .= " (SELECT 1 FROM public.tbl_prestudentstatus spss
|
||||
JOIN public.tbl_prestudent sps USING(prestudent_id)
|
||||
JOIN public.tbl_prestudent sps USING(prestudent_id)
|
||||
WHERE sps.prestudent_id = ps.prestudent_id
|
||||
AND spss.bewerbung_abgeschicktamum IS NOT NULL)";
|
||||
|
||||
@@ -665,4 +666,5 @@ class Prestudent_model extends DB_Model
|
||||
|
||||
return $this->execQuery($query, array($prestudent_id));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -52,6 +52,24 @@ class Prestudentstatus_model extends DB_Model
|
||||
return $this->execQuery($query, $parametersArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* Liefert den Ersten Status eines Prestudenten mit der übergebenen Statuskurzbezeichnung.
|
||||
*
|
||||
* @param $prestudent_id
|
||||
* @param $status_kurzbz
|
||||
* @return array
|
||||
*/
|
||||
public function getFirstStatus($prestudent_id, $status_kurzbz)
|
||||
{
|
||||
$this->addOrder('datum, insertamum, ext_id');
|
||||
$this->addLimit(1);
|
||||
|
||||
return $this->loadWhere(array(
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'status_kurzbz' => $status_kurzbz
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* updateStufe
|
||||
*/
|
||||
|
||||
@@ -66,4 +66,20 @@ class Student_model extends DB_Model
|
||||
|
||||
return $result->retval[0]->student_uid;
|
||||
}
|
||||
|
||||
public function searchStudent($filter)
|
||||
{
|
||||
$this->addSelect('vorname, nachname, gebdatum, person.person_id, student_uid');
|
||||
$this->addJoin('public.tbl_prestudent ps', 'prestudent_id');
|
||||
$this->addJoin('public.tbl_person person', 'person_id');
|
||||
|
||||
$result = $this->loadWhere(
|
||||
"lower(student_uid) like ".$this->db->escape('%'.$filter.'%')."
|
||||
OR lower(person.nachname) like ".$this->db->escape('%'.$filter.'%')."
|
||||
OR lower(person.vorname) like ".$this->db->escape('%'.$filter.'%')."
|
||||
OR lower(person.nachname || ' ' || person.vorname) like ".$this->db->escape('%'.$filter.'%')."
|
||||
OR lower(person.vorname || ' ' || person.nachname) like ".$this->db->escape('%'.$filter.'%'));
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -309,4 +309,166 @@ class Lehrveranstaltung_model extends DB_Model
|
||||
|
||||
return $this->execQuery($query, array($uid, $studiensemester_kurzbz, $lehrveranstaltung_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sucht nach LV Templates und gibt Id und Label ("bezeichnung [kurzbz]") aus
|
||||
* Diese funktion ist für autocomplete gedacht
|
||||
*
|
||||
* @param string $filter Suchfilter
|
||||
* @return \stdClass A return object
|
||||
*/
|
||||
public function loadTemplates($filter)
|
||||
{
|
||||
$filter = strtolower($filter);
|
||||
$qry = "SELECT
|
||||
tbl_lehrveranstaltung.lehrveranstaltung_id, tbl_lehrveranstaltung.bezeichnung, tbl_lehrveranstaltung.kurzbz
|
||||
FROM
|
||||
lehre.tbl_lehrveranstaltung
|
||||
WHERE
|
||||
tbl_lehrveranstaltung.lehrtyp_kurzbz = 'tpl' AND (
|
||||
CAST(tbl_lehrveranstaltung.lehrveranstaltung_id AS TEXT) LIKE '%".$this->db_escape($filter)."%' OR
|
||||
LOWER(tbl_lehrveranstaltung.bezeichnung) LIKE '%".$this->db_escape($filter). "%' OR
|
||||
LOWER(tbl_lehrveranstaltung.kurzbz) LIKE '%".$this->db_escape($filter). "%'
|
||||
)
|
||||
";
|
||||
return $this->execQuery($qry);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lädt Template und gibt Id und Label ("bezeichnung [kurzbz]") zurück
|
||||
* Diese funktion ist für autocomplete gedacht
|
||||
*
|
||||
* @param string $name
|
||||
* @return \stdClass A return object
|
||||
*/
|
||||
public function loadTemplateByName($name)
|
||||
{
|
||||
$qry = "SELECT
|
||||
tbl_lehrveranstaltung.lehrveranstaltung_id as id, CONCAT(tbl_lehrveranstaltung.bezeichnung, ' [', tbl_lehrveranstaltung.kurzbz, ']') as label
|
||||
FROM
|
||||
lehre.tbl_lehrveranstaltung
|
||||
WHERE
|
||||
tbl_lehrveranstaltung.lehrtyp_kurzbz = 'tpl' AND (
|
||||
CAST(tbl_lehrveranstaltung.lehrveranstaltung_id AS TEXT) = '".($name ? $this->db_escape($name) : 0)."' OR tbl_lehrveranstaltung.bezeichnung = '".$this->db_escape($name). "' OR tbl_lehrveranstaltung.kurzbz = '".$this->db_escape($name). "'
|
||||
)
|
||||
";
|
||||
return $this->execQuery($qry);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get ECTS Summe pro angerechnetes Quereinstiegssemester.
|
||||
*
|
||||
* @param $studiengang_kz
|
||||
* @param $studiensemester_kurzbz
|
||||
* @param $ausbildungssemester
|
||||
* @param $orgform_kurzbz
|
||||
* @return array|stdClass|null
|
||||
*/
|
||||
public function getSumQuereinstiegsECTSProSemester($studiengang_kz, $studiensemester_kurzbz, $ausbildungssemester, $orgform_kurzbz)
|
||||
{
|
||||
$qry = '
|
||||
SELECT
|
||||
sum(tbl_lehrveranstaltung.ects) as "sum_ects"
|
||||
FROM
|
||||
lehre.tbl_studienplan
|
||||
JOIN lehre.tbl_studienplan_lehrveranstaltung USING (studienplan_id)
|
||||
JOIN lehre.tbl_lehrveranstaltung USING (lehrveranstaltung_id)
|
||||
WHERE
|
||||
tbl_studienplan.studienplan_id = (
|
||||
SELECT
|
||||
studienplan_id
|
||||
FROM
|
||||
lehre.tbl_studienordnung
|
||||
JOIN lehre.tbl_studienplan USING (studienordnung_id)
|
||||
JOIN lehre.tbl_studienplan_semester USING (studienplan_id)
|
||||
WHERE tbl_studienordnung.studiengang_kz = ?
|
||||
AND tbl_studienplan_semester.semester = ?
|
||||
AND tbl_studienplan_semester.studiensemester_kurzbz = ?
|
||||
AND tbl_studienplan.orgform_kurzbz = ?
|
||||
|
||||
LIMIT 1
|
||||
)
|
||||
AND tbl_studienplan_lehrveranstaltung.semester = ?
|
||||
AND studienplan_lehrveranstaltung_id_parent IS NULL -- auf Modulebene
|
||||
AND tbl_studienplan_lehrveranstaltung.export = TRUE
|
||||
';
|
||||
|
||||
return $this->execQuery($qry, array(
|
||||
$studiengang_kz, $ausbildungssemester, $studiensemester_kurzbz, $orgform_kurzbz, $ausbildungssemester)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ECTS Summe aller bisher angerechneten LVs.
|
||||
* Wenn keine explizite Begruendung angegeben ist, wird eine schulische Begruendung angenommen.
|
||||
*
|
||||
* @param $student_uid
|
||||
* @return array|stdClass|null
|
||||
*/
|
||||
public function getSumAngerechneteECTSByBegruendung($student_uid)
|
||||
{
|
||||
$qry = '
|
||||
SELECT sum(ects), begruendung_id FROM (
|
||||
SELECT
|
||||
lehrveranstaltung_id, studiensemester_kurzbz, ects, COALESCE(begruendung_id, 1) as begruendung_id -- fallback auf externes Zeugnis
|
||||
FROM
|
||||
lehre.tbl_zeugnisnote
|
||||
LEFT JOIN lehre.tbl_anrechnung USING(lehrveranstaltung_id, studiensemester_kurzbz)
|
||||
JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
JOIN public.tbl_student USING(student_uid)
|
||||
WHERE
|
||||
tbl_zeugnisnote.note = 6
|
||||
AND student_uid = ?
|
||||
AND (lehre.tbl_anrechnung.prestudent_id = tbl_student.prestudent_id
|
||||
OR lehre.tbl_anrechnung.prestudent_id is null)
|
||||
|
||||
UNION
|
||||
|
||||
SELECT
|
||||
lehrveranstaltung_id, studiensemester_kurzbz, ects, begruendung_id -- fallback auf externes Zeugnis
|
||||
FROM
|
||||
lehre.tbl_anrechnung
|
||||
JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
JOIN public.tbl_student USING(prestudent_id)
|
||||
WHERE
|
||||
genehmigt_von is not null
|
||||
AND student_uid = ?
|
||||
) lvsangerechnet
|
||||
GROUP BY begruendung_id
|
||||
';
|
||||
|
||||
return $this->execQuery($qry, array($student_uid, $student_uid));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ECTS Summe aller bisher schulisch begruendeten angerechneten LVs.
|
||||
* Derzeit wird auch jede Anrechnung, die nicht beruflich ist, als schulisch angenommen.
|
||||
*
|
||||
* @param $student_uid
|
||||
* @return array|stdClass|null
|
||||
*/
|
||||
public function getEctsSumSchulisch($student_uid, $prestudent_id, $studiengang_kz)
|
||||
{
|
||||
$qry = '
|
||||
SELECT get_ects_summe_schulisch(?, ?, ?) AS ectsSumSchulisch
|
||||
';
|
||||
|
||||
return $this->execQuery($qry, array($student_uid, $prestudent_id, $studiengang_kz));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ECTS Summe aller bisher beruflich angerechneten LVs.
|
||||
*
|
||||
* @param $student_uid
|
||||
* @return array|stdClass|null
|
||||
*/
|
||||
public function getEctsSumBeruflich($student_uid)
|
||||
{
|
||||
$qry = '
|
||||
SELECT get_ects_summe_beruflich(?) AS ectsSumBeruflich
|
||||
';
|
||||
|
||||
return $this->execQuery($qry, array($student_uid));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,34 @@ class Projektbetreuer_model extends DB_Model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Betreuer of a certain Type of a Projektarbeit.
|
||||
* Returns one row for each person.
|
||||
* @param int $projektarbeit_id
|
||||
* @param string $betreuerart_kurzbz
|
||||
* @return array success with number of Betreuer or error
|
||||
*/
|
||||
public function getBetreuerOfProjektarbeit($projektarbeit_id, $betreuerart_kurzbz)
|
||||
{
|
||||
$qry = "SELECT DISTINCT ON (pers.person_id) pers.person_id, betreuerart_kurzbz, vorname, nachname,
|
||||
trim(COALESCE(titelpre,'')||' '||COALESCE(vorname,'')||' '||COALESCE(nachname,'')||' '||COALESCE(titelpost,'')) as voller_name,
|
||||
anrede, titelpre, titelpost, gebdatum, geschlecht, pa.projekttyp_kurzbz,
|
||||
ben.uid, ben.alias, ma.personalnummer, mitarbeiter_uid, student_uid
|
||||
FROM lehre.tbl_projektarbeit pa
|
||||
JOIN lehre.tbl_projektbetreuer USING (projektarbeit_id)
|
||||
JOIN public.tbl_person pers USING (person_id)
|
||||
LEFT JOIN public.tbl_benutzer ben USING (person_id)
|
||||
LEFT JOIN public.tbl_mitarbeiter ma ON ben.uid = ma.mitarbeiter_uid
|
||||
WHERE ben.aktiv
|
||||
AND projektarbeit_id = ?
|
||||
AND betreuerart_kurzbz = ?
|
||||
ORDER BY pers.person_id, CASE WHEN ma.mitarbeiter_uid IS NULL THEN 1 ELSE 0 END, /*Mitarbeiter account first*/
|
||||
CASE WHEN ben.uid IS NULL THEN 1 ELSE 0 END, /*user with account first*/
|
||||
ben.insertamum";
|
||||
|
||||
return $this->execQuery($qry, array($projektarbeit_id, $betreuerart_kurzbz));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Projektbetreuer data by authentification token
|
||||
* @param $zugangstoken
|
||||
@@ -60,4 +88,83 @@ class Projektbetreuer_model extends DB_Model
|
||||
|
||||
return $this->execQuery($qry, array($zugangstoken));
|
||||
}
|
||||
|
||||
/**
|
||||
* Holt Zweitbegutachter einer Projektarbeit mit Mail.
|
||||
* @param $erstbegutachter_person_id int person_id des Erstbegutachters
|
||||
* @param $projektarbeit_id int
|
||||
* @param $student_uid string uid des Studenten der Arbeit abgibt
|
||||
* @return object | bool
|
||||
*/
|
||||
public function getZweitbegutachterWithToken($erstbegutachter_person_id, $projektarbeit_id, $student_uid)
|
||||
{
|
||||
$qry_betr = "SELECT betr.person_id, betr.projektarbeit_id, pers.anrede, betr.zugangstoken, betr.zugangstoken_gueltigbis, tbl_benutzer.uid, kontakt,
|
||||
trim(COALESCE(titelpre,'')||' '||COALESCE(vorname,'')||' '||COALESCE(nachname,'')||' '||COALESCE(titelpost,'')) as voller_name,
|
||||
CASE WHEN tbl_benutzer.uid IS NULL THEN kontakt ELSE tbl_benutzer.uid || '@".DOMAIN."' END AS email, abg.abgabedatum
|
||||
FROM lehre.tbl_projektbetreuer betr
|
||||
JOIN lehre.tbl_projektarbeit parb ON betr.projektarbeit_id = parb.projektarbeit_id
|
||||
JOIN public.tbl_person pers ON betr.person_id = pers.person_id
|
||||
LEFT JOIN public.tbl_kontakt ON pers.person_id = tbl_kontakt.person_id AND kontakttyp = 'email' AND zustellung = true
|
||||
LEFT JOIN public.tbl_benutzer ON pers.person_id = tbl_benutzer.person_id
|
||||
LEFT JOIN campus.tbl_paabgabe abg ON betr.projektarbeit_id = abg.projektarbeit_id AND abg.paabgabetyp_kurzbz = 'end'
|
||||
WHERE betr.betreuerart_kurzbz = 'Zweitbegutachter'
|
||||
AND betr.projektarbeit_id = ?
|
||||
AND parb.student_uid = ?
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM lehre.tbl_projektbetreuer
|
||||
WHERE person_id = ?
|
||||
AND betreuerart_kurzbz = 'Erstbegutachter'
|
||||
AND projektarbeit_id = betr.projektarbeit_id
|
||||
)
|
||||
AND (tbl_benutzer.aktiv OR tbl_benutzer.aktiv IS NULL)
|
||||
ORDER BY betr.insertamum DESC
|
||||
LIMIT 1";
|
||||
|
||||
return $this->execQuery($qry_betr, array($projektarbeit_id, $student_uid, $erstbegutachter_person_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Generiert neuen Token für externen Zweitbetreuer.
|
||||
* @param int $zweitbegutachter_person_id
|
||||
* @param int $projektarbeit_id
|
||||
* @return array
|
||||
*/
|
||||
public function generateZweitbegutachterToken($zweitbegutachter_person_id, $projektarbeit_id)
|
||||
{
|
||||
$betreuerUidQry = "SELECT uid, zugangstoken, zugangstoken_gueltigbis, tbl_projektbetreuer.person_id
|
||||
FROM lehre.tbl_projektbetreuer
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
LEFT JOIN public.tbl_benutzer USING(person_id)
|
||||
WHERE projektarbeit_id = ?
|
||||
AND tbl_projektbetreuer.person_id = ?
|
||||
AND betreuerart_kurzbz = 'Zweitbegutachter'
|
||||
LIMIT 1";
|
||||
|
||||
$betreueruidres = $this->execQuery($betreuerUidQry, array($projektarbeit_id, $zweitbegutachter_person_id));
|
||||
|
||||
if (!hasData($betreueruidres))
|
||||
return error('Zweitbegutachter nicht gefunden');
|
||||
|
||||
$row_betr = getData($betreueruidres)[0];
|
||||
|
||||
if (!isset($row_betr->uid))
|
||||
{
|
||||
do {
|
||||
$token = generateToken(16);
|
||||
$qry_tokencheck = $this->load(array('zugangstoken' => $token));
|
||||
} while(hasData($qry_tokencheck));
|
||||
|
||||
$result = $this->update(
|
||||
array('projektarbeit_id' => $projektarbeit_id,
|
||||
'person_id' => $row_betr->person_id,
|
||||
'betreuerart_kurzbz' => 'Zweitbegutachter'),
|
||||
array('zugangstoken' => $token,
|
||||
'zugangstoken_gueltigbis' => date('Y-m-d', strtotime('+1 year')))
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
return success("Account vorhanden, kein Token benötigt");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,9 +86,10 @@ class Zeugnisnote_model extends DB_Model
|
||||
* @param bool $lehre
|
||||
* @param bool $offiziell
|
||||
* @param bool $positiv
|
||||
* @param bool $zeugnis
|
||||
* @return object
|
||||
*/
|
||||
public function getByPerson($person_id, $studiensemester_kurzbz, $aktiv = true, $lehre = null, $offiziell = null, $positiv = null)
|
||||
public function getByPerson($person_id, $studiensemester_kurzbz, $aktiv = true, $lehre = null, $offiziell = null, $positiv = null, $zeugnis = null)
|
||||
{
|
||||
$params = array($person_id, $studiensemester_kurzbz);
|
||||
|
||||
@@ -129,6 +130,12 @@ class Zeugnisnote_model extends DB_Model
|
||||
$params[] = $positiv;
|
||||
}
|
||||
|
||||
if (isset($zeugnis))
|
||||
{
|
||||
$qry .= ' AND lv.zeugnis = ?';
|
||||
$params[] = $zeugnis;
|
||||
}
|
||||
|
||||
$qry .= ' ORDER BY zgnisnote.benotungsdatum';
|
||||
|
||||
return $this->execQuery($qry, $params);
|
||||
|
||||
@@ -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,26 +475,32 @@ 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);
|
||||
}
|
||||
|
||||
public function getStudiengaengeWithOrgForm($typ, $semester)
|
||||
{
|
||||
$query = "SELECT DISTINCT (UPPER(sg.typ || sg.kurzbz || ':' || sp.orgform_kurzbz)) AS Studiengang
|
||||
$query = "SELECT DISTINCT (UPPER(so.studiengangkurzbzlang || ':' || sp.orgform_kurzbz)) AS Studiengang
|
||||
FROM public.tbl_studiengang sg
|
||||
JOIN lehre.tbl_studienordnung USING (studiengang_kz)
|
||||
JOIN lehre.tbl_studienplan sp USING (studienordnung_id)
|
||||
JOIN lehre.tbl_studienplan_semester spsem USING (studienplan_id)
|
||||
JOIN lehre.tbl_studienordnung so USING(studienordnung_id)
|
||||
WHERE sp.aktiv = TRUE AND sg.aktiv = TRUE AND sg.typ IN ?
|
||||
AND spsem.studiensemester_kurzbz = ?
|
||||
ORDER BY Studiengang";
|
||||
|
||||
@@ -13,6 +13,20 @@ class Studiensemester_model extends DB_Model
|
||||
$this->hasSequence = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get actual Studiensemester.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAkt()
|
||||
{
|
||||
return $this->loadWhere(array(
|
||||
'start <= ' => 'NOW()',
|
||||
'ende >= ' => 'NOW()'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Get next study semester
|
||||
public function getNext()
|
||||
{
|
||||
@@ -91,7 +105,7 @@ class Studiensemester_model extends DB_Model
|
||||
/**
|
||||
* getPreviousFrom
|
||||
*/
|
||||
public function getPreviousFrom($studiensemester_kurzbz)
|
||||
public function getPreviousFrom($studiensemester_kurzbz, $limit = 1)
|
||||
{
|
||||
$query = 'SELECT studiensemester_kurzbz,
|
||||
start,
|
||||
@@ -103,9 +117,9 @@ class Studiensemester_model extends DB_Model
|
||||
WHERE studiensemester_kurzbz = ?
|
||||
)
|
||||
ORDER BY start DESC
|
||||
LIMIT 1';
|
||||
LIMIT ?';
|
||||
|
||||
return $this->execQuery($query, array($studiensemester_kurzbz));
|
||||
return $this->execQuery($query, array($studiensemester_kurzbz, $limit));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -167,15 +181,13 @@ class Studiensemester_model extends DB_Model
|
||||
if (date_format(date_create($from), 'Y-m-d') > (date_format(date_create($to), 'Y-m-d')))
|
||||
return success(array());
|
||||
|
||||
$query = "SELECT *
|
||||
FROM public.tbl_studiensemester
|
||||
WHERE
|
||||
(ende > ?::date AND start < ?::date)
|
||||
OR start = ?::date
|
||||
OR ende = ?::date
|
||||
ORDER BY start DESC";
|
||||
$query = "
|
||||
SELECT *
|
||||
FROM public.tbl_studiensemester
|
||||
WHERE ( ?::date < ende AND ?::date > start )
|
||||
ORDER BY start DESC";
|
||||
|
||||
return $this->execQuery($query, array($from, $to, $from, $to));
|
||||
return $this->execQuery($query, array($from, $to));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
class Fotostatusperson_model extends DB_Model
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_person_fotostatus';
|
||||
$this->pk = 'person_fotostatus_id';
|
||||
}
|
||||
|
||||
public function getLastFotoStatus($person_id)
|
||||
{
|
||||
$this->addOrder('datum', 'DESC');
|
||||
$this->addOrder('person_fotostatus_id', 'DESC');
|
||||
$this->addLimit(1);
|
||||
|
||||
return $this->loadWhere(array('person_id' => $person_id));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -82,7 +82,7 @@ class Person_model extends DB_Model
|
||||
}
|
||||
else
|
||||
{
|
||||
$person['svnr'] = $person['svnr'] . 'v' . ($result->retval[0]->svnr{11} + 1);
|
||||
$person['svnr'] = $person['svnr'] . 'v' . ($result->retval[0]->svnr[11] + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -165,7 +165,7 @@ class Person_model extends DB_Model
|
||||
if (!hasData($person))
|
||||
return success(null);
|
||||
|
||||
$this->KontaktModel->addSelect('kontakttyp, anmerkung, kontakt, zustellung');
|
||||
$this->KontaktModel->addSelect('kontakt_id, kontakttyp, anmerkung, kontakt, zustellung');
|
||||
$this->KontaktModel->addOrder('kontakttyp');
|
||||
$this->KontaktModel->addOrder('insertamum', 'DESC');
|
||||
$where = $zustellung_only === true ? array('person_id' => $person_id, 'zustellung' => true) : array('person_id' => $person_id);
|
||||
@@ -193,7 +193,7 @@ class Person_model extends DB_Model
|
||||
*/
|
||||
public function getByUid($uid)
|
||||
{
|
||||
$this->addSelect('vorname, nachname, gebdatum, person_id, bpk, matr_nr');
|
||||
$this->addSelect('vorname, nachname, gebdatum, person_id, bpk, matr_nr, foto');
|
||||
$this->addJoin('tbl_benutzer', 'person_id');
|
||||
|
||||
return $this->loadWhere(array('uid' => $uid));
|
||||
@@ -268,16 +268,71 @@ class Person_model extends DB_Model
|
||||
|
||||
public function checkDuplicate($person_id)
|
||||
{
|
||||
$qry = "SELECT sp.person_id
|
||||
FROM public.tbl_person p
|
||||
LEFT JOIN public.tbl_person sp ON p.vorname = sp.vorname
|
||||
AND p.nachname = sp.nachname
|
||||
AND p.gebdatum = sp.gebdatum
|
||||
JOIN public.tbl_prestudent ps ON sp.person_id = ps.person_id
|
||||
JOIN public.tbl_prestudentstatus pss ON ps.prestudent_id = pss.prestudent_id
|
||||
WHERE p.person_id = ? AND sp.person_id != ? AND pss.status_kurzbz = ?";
|
||||
$qry = "SELECT person_id
|
||||
FROM public.tbl_prestudent p
|
||||
JOIN
|
||||
(
|
||||
SELECT DISTINCT ON(prestudent_id) *
|
||||
FROM public.tbl_prestudentstatus
|
||||
WHERE prestudent_id IN
|
||||
(
|
||||
SELECT prestudent_id
|
||||
FROM public.tbl_prestudent
|
||||
WHERE person_id IN
|
||||
(
|
||||
SELECT p2.person_id
|
||||
FROM public.tbl_person p
|
||||
JOIN public.tbl_person p2
|
||||
ON lower(p.vorname) = lower(p2.vorname)
|
||||
AND lower(p.nachname) = lower(p2.nachname)
|
||||
AND p.gebdatum = p2.gebdatum
|
||||
AND p.person_id = ?
|
||||
)
|
||||
)
|
||||
ORDER BY prestudent_id, datum DESC, insertamum DESC
|
||||
) ps USING(prestudent_id)
|
||||
JOIN public.tbl_status USING(status_kurzbz)
|
||||
WHERE status_kurzbz = 'Interessent'
|
||||
AND studiengang_kz IN
|
||||
(
|
||||
SELECT studiengang_kz
|
||||
FROM public.tbl_prestudent p
|
||||
JOIN
|
||||
(
|
||||
SELECT DISTINCT ON(prestudent_id) *
|
||||
FROM public.tbl_prestudentstatus
|
||||
WHERE prestudent_id IN
|
||||
(
|
||||
SELECT prestudent_id
|
||||
FROM public.tbl_prestudent
|
||||
WHERE person_id IN
|
||||
(
|
||||
SELECT p2.person_id
|
||||
FROM public.tbl_person p
|
||||
JOIN public.tbl_person p2
|
||||
ON lower(p.vorname) = lower(p2.vorname)
|
||||
AND lower(p.nachname) = lower(p2.nachname)
|
||||
AND p.gebdatum = p2.gebdatum
|
||||
AND p.person_id = ?
|
||||
)
|
||||
)
|
||||
ORDER BY prestudent_id, datum DESC, insertamum DESC
|
||||
) ps USING(prestudent_id)
|
||||
JOIN public.tbl_status USING(status_kurzbz)
|
||||
WHERE status_kurzbz = 'Abbrecher'
|
||||
)
|
||||
|
||||
UNION
|
||||
|
||||
return $this->execQuery($qry, array($person_id, $person_id, 'Abbrecher'));
|
||||
SELECT p2.person_id
|
||||
FROM tbl_person p1
|
||||
INNER JOIN (
|
||||
SELECT vorname, nachname, gebdatum, person_id
|
||||
FROM tbl_person
|
||||
) p2
|
||||
ON (lower(p1.vorname) = lower(p2.vorname) AND lower(p1.nachname) = lower(p2.nachname) AND p1.gebdatum = p2.gebdatum)
|
||||
WHERE p1.person_id != p2.person_id AND (p1.person_id = ?)";
|
||||
|
||||
return $this->execQuery($qry, array($person_id, $person_id, $person_id));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,4 +55,45 @@ class Betriebsmittelperson_model extends DB_Model
|
||||
|
||||
return $this->loadWhere($condition);
|
||||
}
|
||||
|
||||
public function getBetriebsmittelZuordnung($cardIdentifier, $typ = 'Zutrittskarte', $ausgegeben = true)
|
||||
{
|
||||
$this->addJoin('wawi.tbl_betriebsmittel', 'betriebsmittel_id');
|
||||
|
||||
$where = 'wawi.tbl_betriebsmittel.nummer2 = \'' . $cardIdentifier . '\'
|
||||
AND wawi.tbl_betriebsmittel.betriebsmitteltyp = \''. $typ .'\'
|
||||
AND (retouram >= now() OR retouram IS NULL)
|
||||
';
|
||||
|
||||
if ($ausgegeben)
|
||||
$where .= 'AND ausgegebenam <= now()';
|
||||
else
|
||||
$where .= 'AND (ausgegebenam <= now() OR ausgegebenam IS NULL)';
|
||||
|
||||
return $this->loadWhere($where);
|
||||
}
|
||||
|
||||
public function getBetriebsmittelByUid($uid, $betriebsmitteltyp = null, $isRetourniert = false)
|
||||
{
|
||||
$this->addJoin('wawi.tbl_betriebsmittel', 'betriebsmittel_id');
|
||||
|
||||
$condition = ' wawi.tbl_betriebsmittelperson.uid = '. $this->escape($uid);
|
||||
|
||||
if (is_string($betriebsmitteltyp))
|
||||
{
|
||||
$condition .= ' AND betriebsmitteltyp = ' . $this->escape($betriebsmitteltyp);
|
||||
}
|
||||
|
||||
if ($isRetourniert === true) {
|
||||
$condition .= ' AND retouram IS NOT NULL';
|
||||
}
|
||||
elseif ($isRetourniert === false)
|
||||
{
|
||||
$condition .= ' AND retouram IS NULL';
|
||||
}
|
||||
|
||||
$this->addOrder('ausgegebenam', 'DESC');
|
||||
|
||||
return $this->loadWhere($condition);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,4 +61,98 @@ class Stundenplandev_model extends DB_Model
|
||||
|
||||
return $this->execQuery($qry, $parametersArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Stundenplan data.
|
||||
*
|
||||
* @param null $lehrveranstaltung_id
|
||||
* @param null $studiensemester_kurzbz
|
||||
* @param null $lehreinheit_id
|
||||
* @param null $mitarbeiter_uid
|
||||
* @param null $student_uid
|
||||
* @param false $nurBevorstehende If true, only future data is retrieved.
|
||||
* @return array|false|stdClass|null
|
||||
*/
|
||||
public function getStundenplanData($lehrveranstaltung_id=null, $studiensemester_kurzbz=null, $lehreinheit_id=null, $mitarbeiter_uid=null, $student_uid=null, $nurBevorstehende = false)
|
||||
{
|
||||
$params = array();
|
||||
|
||||
$qry = "SELECT
|
||||
stpl.datum, min(stpl.stunde) as stundevon, max(stpl.stunde) as stundebis,
|
||||
stpl.lehreinheit_id, lehrfach.bezeichnung as lehrfach_bezeichnung,
|
||||
array_agg(
|
||||
CASE WHEN gruppe_kurzbz is not null THEN gruppe_kurzbz
|
||||
ELSE (SELECT UPPER(typ || kurzbz) FROM public.tbl_studiengang WHERE studiengang_kz=stpl.studiengang_kz) || COALESCE(stpl.semester,'0') || COALESCE(stpl.verband,'') || COALESCE(stpl.gruppe,'')
|
||||
END) as gruppen, array_agg(mitarbeiter_uid) as lektoren,
|
||||
array_agg(ort_kurzbz) as orte,
|
||||
array_agg(titel) as titel
|
||||
FROM
|
||||
lehre.tbl_stundenplandev as stpl
|
||||
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
|
||||
JOIN lehre.tbl_lehrveranstaltung as lehrfach ON(tbl_lehreinheit.lehrfach_id=lehrfach.lehrveranstaltung_id)
|
||||
WHERE ";
|
||||
|
||||
if ($lehrveranstaltung_id != '')
|
||||
{
|
||||
$qry.="
|
||||
lehreinheit_id IN (
|
||||
SELECT lehreinheit_id FROM lehre.tbl_lehreinheit
|
||||
WHERE lehrveranstaltung_id = ?
|
||||
AND studiensemester_kurzbz = ?
|
||||
)";
|
||||
|
||||
$params[]= $lehrveranstaltung_id;
|
||||
$params[]= $studiensemester_kurzbz;
|
||||
|
||||
}
|
||||
elseif ($lehreinheit_id!='')
|
||||
{
|
||||
$qry.=" lehreinheit_id = ?";
|
||||
|
||||
$params[]= $lehreinheit_id;
|
||||
}
|
||||
elseif ($mitarbeiter_uid != '')
|
||||
{
|
||||
$qry.= "
|
||||
mitarbeiter_uid = ?
|
||||
AND lehreinheit_id IN (
|
||||
SELECT lehreinheit_id
|
||||
FROM lehre.tbl_lehreinheitmitarbeiter
|
||||
JOIN lehre.tbl_lehreinheit USING (lehreinheit_id)
|
||||
WHERE mitarbeiter_uid = ?
|
||||
AND studiensemester_kurzbz IN ( ? )
|
||||
)";
|
||||
$params[] = $mitarbeiter_uid;
|
||||
$params[] = $mitarbeiter_uid;
|
||||
$params[] = $studiensemester_kurzbz;
|
||||
}
|
||||
elseif ($student_uid != '')
|
||||
{
|
||||
$qry.="
|
||||
lehreinheit_id IN (
|
||||
SELECT lehreinheit_id
|
||||
FROM campus.vw_student_lehrveranstaltung
|
||||
WHERE uid = ?
|
||||
AND studiensemester_kurzbz = ?
|
||||
)";
|
||||
|
||||
$params[] = $student_uid;
|
||||
$params[] = $studiensemester_kurzbz;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
if($nurBevorstehende)
|
||||
{
|
||||
$qry.= " AND stpl.datum >= NOW()::date ";
|
||||
}
|
||||
|
||||
$qry.= "
|
||||
GROUP BY stpl.datum, stpl.unr, stpl.lehreinheit_id, lehrfach.bezeichnung
|
||||
ORDER BY stpl.datum, min(stpl.stunde), stpl.unr, stpl.lehreinheit_id
|
||||
";
|
||||
|
||||
return $this->execQuery($qry, $params);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,6 +12,47 @@ class Zeitsperre_model extends DB_Model
|
||||
$this->pk = 'zeitsperre_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* Save or update Zeitsperre.
|
||||
*
|
||||
* @param $zeitsperretyp_kurzbz
|
||||
* @param $mitarbeiter_uid
|
||||
* @param $vonDatum
|
||||
* @param $bisDatum
|
||||
* @param null $vonStunde
|
||||
* @param null $bisStunde
|
||||
* @param null $bezeichnung
|
||||
* @param null $vertretung_uid
|
||||
* @param null $erreichbarkeit_kurzbz
|
||||
* @param null $freigabeamum
|
||||
* @param null $freigabevon
|
||||
* @return array
|
||||
*/
|
||||
public function save($zeitsperretyp_kurzbz, $mitarbeiter_uid, $vonDatum, $bisDatum,
|
||||
$vonStunde = null, $bisStunde = null, $bezeichnung = null, $vertretung_uid = null,
|
||||
$erreichbarkeit_kurzbz = null, $freigabeamum = null, $freigabevon = null)
|
||||
{
|
||||
return $this->insert(array(
|
||||
'zeitsperretyp_kurzbz' => $zeitsperretyp_kurzbz,
|
||||
'mitarbeiter_uid' => $mitarbeiter_uid,
|
||||
'vondatum' => $vonDatum,
|
||||
'bisdatum' => $bisDatum,
|
||||
'vonstunde' => $vonStunde,
|
||||
'bisstunde' => $bisStunde,
|
||||
'bezeichnung' => $bezeichnung,
|
||||
'vertretung_uid' => $vertretung_uid,
|
||||
'insertvon' => getAuthUID(),
|
||||
'insertamum' => (new DateTime())->format('Y-m-d H:i:s'),
|
||||
'erreichbarkeit_kurzbz' => $erreichbarkeit_kurzbz,
|
||||
'freigabeamum' => $freigabeamum,
|
||||
'freigabevon' => $freigabevon
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Zeitsperre.
|
||||
* @return array|stdClass|null
|
||||
*/
|
||||
public function deleteEntriesForCurrentDay()
|
||||
{
|
||||
$today = date('Y-m-d');
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Zeitwunsch_gueltigkeit_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'campus.tbl_zeitwunsch_gueltigkeit';
|
||||
$this->pk = 'zeitwunsch_gueltigkeit_id';
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ class Benutzerrolle_model extends DB_Model
|
||||
* @param null $oe_kurzbz
|
||||
* @return array
|
||||
*/
|
||||
public function getBenutzerByBerechtigung($berechtigung_kurzbz, $oe_kurzbz = null)
|
||||
public function getBenutzerByBerechtigung($berechtigung_kurzbz, $oe_kurzbz = null, $art = null)
|
||||
{
|
||||
$params = array();
|
||||
$query = '
|
||||
@@ -62,6 +62,12 @@ class Benutzerrolle_model extends DB_Model
|
||||
$params[] = $oe_kurzbz;
|
||||
}
|
||||
|
||||
if (!is_null($art))
|
||||
{
|
||||
$query .= ' AND art = ?';
|
||||
$params[] = $art;
|
||||
}
|
||||
|
||||
return $this->execQuery($query, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
class Fehlerzustaendigkeiten_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'system.tbl_fehler_zustaendigkeiten';
|
||||
$this->pk = 'fehlerzustaendigkeiten_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets active Mitarbeiter not assigned to a Fehler.
|
||||
* @param $fehlercode
|
||||
* @return object
|
||||
*/
|
||||
public function getNonAssignedMitarbeiter($fehlercode)
|
||||
{
|
||||
$query = "SELECT person_id, ben.uid, vorname, nachname, titelpre, titelpost, personalnummer
|
||||
FROM public.tbl_mitarbeiter
|
||||
JOIN public.tbl_benutzer ben ON tbl_mitarbeiter.mitarbeiter_uid = ben.uid
|
||||
JOIN public.tbl_person pers USING (person_id)
|
||||
WHERE ben.aktiv
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM system.tbl_fehler_zustaendigkeiten
|
||||
WHERE person_id = pers.person_id
|
||||
AND fehlercode = ?
|
||||
)
|
||||
ORDER BY nachname, vorname, uid";
|
||||
|
||||
return $this->execReadOnlyQuery($query, array($fehlercode));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Funktionen not assigned to a Fehler (over an organisational unit).
|
||||
* @param $fehlercode
|
||||
* @param $oe_kurzbz
|
||||
* @return object
|
||||
*/
|
||||
public function getNonAssignedFunktionen($fehlercode, $oe_kurzbz)
|
||||
{
|
||||
$query = "SELECT funktion_kurzbz, beschreibung
|
||||
FROM public.tbl_funktion funk
|
||||
WHERE aktiv
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM system.tbl_fehler_zustaendigkeiten
|
||||
WHERE funktion_kurzbz = funk.funktion_kurzbz
|
||||
AND fehlercode = ?
|
||||
AND oe_kurzbz = ?
|
||||
)
|
||||
ORDER BY beschreibung";
|
||||
|
||||
return $this->execReadOnlyQuery($query, array($fehlercode, $oe_kurzbz));
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,45 @@ class Issue_model extends DB_Model
|
||||
$this->pk = 'issue_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets issues which are open, i.e. not resolved.
|
||||
* @param array $fehlercodes only issues for given fehler are retrieved
|
||||
* @param int $person_id
|
||||
* @param string $oe_kurzbz
|
||||
* @param string $fehlercode_extern
|
||||
* @return object success with issues or error
|
||||
*/
|
||||
public function getOpenIssues($fehlercodes, $person_id = null, $oe_kurzbz = null, $fehlercode_extern = null)
|
||||
{
|
||||
$params = array($fehlercodes);
|
||||
// issue exists for a fehlercode (or fehlercode_extern), person_id, oe_kurzbz, if not verarbeitet yet
|
||||
$qry = 'SELECT issue_id, fehlercode, inhalt, fehlercode_extern, inhalt_extern, person_id, oe_kurzbz,
|
||||
behebung_parameter, datum, verarbeitetvon, verarbeitetamum
|
||||
FROM system.tbl_issue
|
||||
WHERE fehlercode IN ?
|
||||
AND verarbeitetamum IS NULL';
|
||||
|
||||
if (!isEmptyString($fehlercode_extern))
|
||||
{
|
||||
$qry .= ' AND fehlercode_extern = ?';
|
||||
$params[] = $fehlercode_extern;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= ' AND person_id = ?';
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($oe_kurzbz))
|
||||
{
|
||||
$qry .= ' AND oe_kurzbz = ?';
|
||||
$params[] = $oe_kurzbz;
|
||||
}
|
||||
|
||||
return $this->execQuery($qry, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets number of open (non-resolved) issues.
|
||||
* @param string $fehlercode unique error code
|
||||
|
||||
@@ -12,7 +12,14 @@ class Variablenname_model extends DB_Model
|
||||
) sem
|
||||
WHERE start > now()
|
||||
LIMIT 1;',
|
||||
'infocenter_studiensgangtyp' => 'SELECT infocenter_studiensgangtyp FROM public.tbl_variablenname LIMIT 1'
|
||||
'infocenter_studiensgangtyp' => 'SELECT infocenter_studiensgangtyp FROM public.tbl_variablenname LIMIT 1;',
|
||||
'projektuebersicht_studiensemester' => 'SELECT studiensemester_kurzbz FROM (
|
||||
SELECT DISTINCT ON (studienjahr_kurzbz) start, studiensemester_kurzbz
|
||||
FROM public.tbl_studiensemester
|
||||
ORDER BY studienjahr_kurzbz, start
|
||||
) sem
|
||||
WHERE start > now()
|
||||
LIMIT 1;'
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,7 +25,8 @@ $this->load->view(
|
||||
'bitteBegruendungAngeben',
|
||||
'empfehlungWurdeAngefordert',
|
||||
'anrechnungenWurdenGenehmigt',
|
||||
'anrechnungenWurdenAbgelehnt'
|
||||
'anrechnungenWurdenAbgelehnt',
|
||||
'nurLeseberechtigung'
|
||||
),
|
||||
'person' => array(
|
||||
'student',
|
||||
@@ -43,7 +44,8 @@ $this->load->view(
|
||||
'empfehlungsanforderungWirklichZuruecknehmen',
|
||||
'erfolgreichZurueckgenommen',
|
||||
'empfehlungPositivConfirmed',
|
||||
'empfehlungNegativConfirmed'
|
||||
'empfehlungNegativConfirmed',
|
||||
'anrechnungEctsTooltipTextBeiUeberschreitung'
|
||||
)
|
||||
),
|
||||
'customCSSs' => array(
|
||||
@@ -58,7 +60,6 @@ $this->load->view(
|
||||
);
|
||||
?>
|
||||
|
||||
<body>
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<!-- header -->
|
||||
@@ -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">
|
||||
@@ -123,11 +124,27 @@ $this->load->view(
|
||||
|
||||
<tr>
|
||||
<th class="col-xs-4"><?php echo $this->p->t('lehre', 'ects'); ?></th>
|
||||
<td><?php echo $antragData->ects ?></td>
|
||||
<td colspan="3"><span id="ects"><?php echo $antragData->ects ?></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="col-xs-4">
|
||||
<?php echo $this->p->t('anrechnung', 'bisherAngerechneteEcts'); ?>
|
||||
<span class="approveAnrechnungDetail-anrechnungEctsTooltip"
|
||||
data-toggle="tooltip" data-placement="right"
|
||||
title="<?php echo $this->p->t('anrechnung', 'anrechnungEctsTooltipText'); ?>">
|
||||
<i class="fa fa-lg fa-info-circle" aria-hidden="true"></i>
|
||||
</span>
|
||||
</th>
|
||||
<td colspan="3">
|
||||
Total: <span id="sumEctsTotal"><?php echo number_format($antragData->sumEctsSchulisch + $antragData->sumEctsBeruflich, 1) ?></span>
|
||||
[Schulisch: <span id="sumEctsSchulisch" value="<?php echo $antragData->sumEctsSchulisch ?>"><?php echo $antragData->sumEctsSchulisch ?></span> /
|
||||
Beruflich: <span id="sumEctsBeruflich" value="<?php echo $antragData->sumEctsBeruflich ?>"><?php echo $antragData->sumEctsBeruflich ?></span> ]
|
||||
<span id="sumEctsMsg"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="col-xs-4"><?php echo $this->p->t('lehre', 'lektorInnen'); ?></th>
|
||||
<td>
|
||||
<td colspan="3">
|
||||
<?php $len = count($antragData->lektoren) - 1 ?>
|
||||
<?php foreach ($antragData->lektoren as $key => $lektor): ?>
|
||||
<?php echo $lektor->vorname . ' ' . $lektor->nachname;
|
||||
@@ -137,19 +154,23 @@ $this->load->view(
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="col-xs-4"><?php echo ucfirst($this->p->t('global', 'zgv')); ?></th>
|
||||
<td><?php echo $antragData->zgv ?></td>
|
||||
<td colspan="3"><?php echo $antragData->zgv ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="col-xs-4"><?php echo $this->p->t('anrechnung', 'herkunftDerKenntnisse'); ?></th>
|
||||
<td><?php echo $anrechnungData->anmerkung ?></td>
|
||||
<td colspan="3"><?php echo $anrechnungData->anmerkung ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="col-xs-4"><?php echo $this->p->t('anrechnung', 'nachweisdokumente'); ?></th>
|
||||
<td>
|
||||
<td colspan="3">
|
||||
<a href="<?php echo current_url() . '/download?dms_id=' . $anrechnungData->dms_id; ?>"
|
||||
target="_blank"><?php echo htmlentities($anrechnungData->dokumentname) ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="col-xs-4"><?php echo $this->p->t('global', 'begruendung'); ?></th>
|
||||
<td colspan="3"><span id="begruendung_id" data-begruendung_id="<?php echo $anrechnungData->begruendung_id ?>" ><?php echo $anrechnungData->begruendung ?></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -177,8 +198,10 @@ $this->load->view(
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<form id="form-empfehlung">
|
||||
<input type="hidden" name="anrechnung_id"
|
||||
value="<?php echo $anrechnungData->anrechnung_id ?>">
|
||||
<input type="hidden" name="anrechnung_id" value="<?php echo $anrechnungData->anrechnung_id ?>">
|
||||
<input type="hidden" name="ects" value="<?php echo $antragData->ects ?>">
|
||||
<input type="hidden" name="sumEctsSchulisch" value="<?php echo $antragData->sumEctsSchulisch ?>">
|
||||
<input type="hidden" name="sumEctsBeruflich" value="<?php echo $antragData->sumEctsBeruflich ?>">
|
||||
<table class="table table-bordered table-condensed table-fixed">
|
||||
<tbody>
|
||||
<tr>
|
||||
@@ -290,38 +313,44 @@ $this->load->view(
|
||||
<div style="display: none" id="approveAnrechnungDetail-begruendung-panel">
|
||||
<div>
|
||||
<h4 class="panel panel-body panel-danger text-danger"><?php echo $this->p->t('anrechnung', 'genehmigungNegativQuestion'); ?></h4>
|
||||
<b> <?php echo $this->p->t('anrechnung', 'bitteBegruendungAngeben'); ?></b><br><br>
|
||||
<ul>
|
||||
<li>
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
<span><?php echo $this->p->t('anrechnung', 'genehmigungNegativPruefungNichtMoeglich'); ?></span>
|
||||
<span class="btn-copyIntoTextarea" data-toggle="tooltip"
|
||||
<span class="btn-copyIntoTextarea pull-right" data-toggle="tooltip"
|
||||
data-placement="right"
|
||||
title="<?php echo $this->p->t('ui', 'textUebernehmen'); ?>">
|
||||
<i class="fa fa-clipboard" aria-hidden="true"></i>
|
||||
<i class="fa fa-clipboard fa-lg" aria-hidden="true"></i>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<li class="list-group-item">
|
||||
<span><?php echo $this->p->t('anrechnung', 'genehmigungNegativKenntnisseNichtGleichwertig'); ?></span>
|
||||
<span class="btn-copyIntoTextarea" data-toggle="tooltip"
|
||||
<span class="btn-copyIntoTextarea pull-right" data-toggle="tooltip"
|
||||
data-placement="right"
|
||||
title="<?php echo $this->p->t('ui', 'textUebernehmen'); ?>">
|
||||
<i class="fa fa-clipboard" aria-hidden="true"></i>
|
||||
<i class="fa fa-clipboard fa-lg" aria-hidden="true"></i>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<li class="list-group-item">
|
||||
<span><?php echo $this->p->t('anrechnung', 'genehmigungNegativEctsHoechstgrenzeUeberschritten'); ?></span>
|
||||
<span class="btn-copyIntoTextarea pull-right" data-toggle="tooltip"
|
||||
data-placement="right"
|
||||
title="<?php echo $this->p->t('ui', 'textUebernehmen'); ?>">
|
||||
<i class="fa fa-clipboard fa-lg" aria-hidden="true"></i>
|
||||
</span>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<span><?php echo $this->p->t('anrechnung', 'genehmigungNegativEmpfehlungstextUebernehmen'); ?></span>
|
||||
<span id="empfehlungstextUebernehmen" class="btn-copyIntoTextarea" data-toggle="tooltip"
|
||||
<span id="empfehlungstextUebernehmen" class="btn-copyIntoTextarea pull-right" data-toggle="tooltip"
|
||||
data-placement="right"
|
||||
title="<?php echo $this->p->t('ui', 'textUebernehmen'); ?>">
|
||||
<i class="fa fa-clipboard" aria-hidden="true"></i>
|
||||
<i class="fa fa-clipboard fa-lg" aria-hidden="true"></i>
|
||||
</span>
|
||||
</li>
|
||||
<li><?php echo $this->p->t('anrechnung', 'andereBegruendung'); ?></li>
|
||||
</ul>
|
||||
<br>
|
||||
<textarea class="form-control" name="begruendung"
|
||||
id="approveAnrechnungDetail-begruendung"
|
||||
rows="2" required></textarea>
|
||||
rows="2"
|
||||
placeholder="<?php echo $this->p->t('anrechnung', 'textUebernehmenOderEigenenBegruendungstext'); ?>" required></textarea>
|
||||
</div>
|
||||
<br>
|
||||
<!-- Action Button 'Abbrechen'-->
|
||||
@@ -398,6 +427,5 @@ $this->load->view(
|
||||
|
||||
</div><!--end container-fluid-->
|
||||
</div><!--end page-wrapper-->
|
||||
</body>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
|
||||
@@ -48,7 +48,8 @@ $this->load->view(
|
||||
'empfehlungWurdeAngefordert',
|
||||
'empfehlungWurdeAngefordertAusnahmeWoKeineLektoren',
|
||||
'anrechnungenWurdenGenehmigt',
|
||||
'anrechnungenWurdenAbgelehnt'
|
||||
'anrechnungenWurdenAbgelehnt',
|
||||
'nurLeseberechtigung'
|
||||
),
|
||||
'person' => array(
|
||||
'student',
|
||||
@@ -86,7 +87,6 @@ $this->load->view(
|
||||
);
|
||||
?>
|
||||
|
||||
<body>
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<!-- title -->
|
||||
@@ -101,7 +101,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(
|
||||
@@ -133,28 +133,34 @@ $this->load->view(
|
||||
id="approveAnrechnungUebersicht-begruendung-panel">
|
||||
<div>
|
||||
<h4 class="panel panel-body panel-danger text-danger"><?php echo $this->p->t('anrechnung', 'genehmigungenNegativQuestion'); ?></h4>
|
||||
<b><?php echo $this->p->t('anrechnung', 'bitteBegruendungAngeben'); ?></b><br><br>
|
||||
<ol>
|
||||
<li><?php echo $this->p->t('anrechnung', 'genehmigungNegativPruefungNichtMoeglich'); ?>
|
||||
<span class="btn-copyIntoTextarea" data-toggle="tooltip" data-placement="left"
|
||||
title="<?php echo $this->p->t('ui', 'textUebernehmen'); ?>">
|
||||
<i class="fa fa-clipboard" aria-hidden="true"></i>
|
||||
</span>
|
||||
</li>
|
||||
<li><?php echo $this->p->t('anrechnung', 'genehmigungNegativKenntnisseNichtGleichwertig'); ?>
|
||||
<span class="btn-copyIntoTextarea" data-toggle="tooltip" data-placement="left"
|
||||
title="<?php echo $this->p->t('ui', 'textUebernehmen'); ?>">
|
||||
<i class="fa fa-clipboard" aria-hidden="true"></i>
|
||||
</span>
|
||||
</li>
|
||||
<li><?php echo $this->p->t('anrechnung', 'andereBegruendung'); ?></li>
|
||||
</ol>
|
||||
<br>
|
||||
<b><?php echo $this->p->t('anrechnung', 'bitteBegruendungAngeben'); ?>
|
||||
<span class="text-danger">
|
||||
<?php echo $this->p->t('anrechnung', 'begruendungWirdFuerAlleUebernommen'); ?>
|
||||
</span><br><br>
|
||||
</span></b>
|
||||
<br><br>
|
||||
<ol class="list-group">
|
||||
<li class="list-group-item"><?php echo $this->p->t('anrechnung', 'genehmigungNegativPruefungNichtMoeglich'); ?>
|
||||
<span class="btn-copyIntoTextarea pull-right" data-toggle="tooltip" data-placement="left"
|
||||
title="<?php echo $this->p->t('ui', 'textUebernehmen'); ?>">
|
||||
<i class="fa fa-clipboard fa-lg" aria-hidden="true"></i>
|
||||
</span>
|
||||
</li>
|
||||
<li class="list-group-item"><?php echo $this->p->t('anrechnung', 'genehmigungNegativKenntnisseNichtGleichwertig'); ?>
|
||||
<span class="btn-copyIntoTextarea pull-right" data-toggle="tooltip" data-placement="left"
|
||||
title="<?php echo $this->p->t('ui', 'textUebernehmen'); ?>">
|
||||
<i class="fa fa-clipboard fa-lg" aria-hidden="true"></i>
|
||||
</span>
|
||||
</li>
|
||||
<li class="list-group-item"><?php echo $this->p->t('anrechnung', 'genehmigungNegativEctsHoechstgrenzeUeberschritten'); ?>
|
||||
<span class="btn-copyIntoTextarea pull-right" data-toggle="tooltip" data-placement="left"
|
||||
title="<?php echo $this->p->t('ui', 'textUebernehmen'); ?>">
|
||||
<i class="fa fa-clipboard fa-lg" aria-hidden="true"></i>
|
||||
</span>
|
||||
</li>
|
||||
</ol>
|
||||
<textarea class="form-control" name="begruendung" id="approveAnrechnungUebersicht-begruendung"
|
||||
rows="2" required></textarea>
|
||||
rows="2"
|
||||
placeholder="<?php echo $this->p->t('anrechnung', 'textUebernehmenOderEigenenBegruendungstext'); ?>" required></textarea>
|
||||
</div>
|
||||
<br>
|
||||
<!-- Action Button 'Abbrechen'-->
|
||||
@@ -226,7 +232,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>
|
||||
@@ -248,6 +254,5 @@ $this->load->view(
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
|
||||
@@ -16,15 +16,20 @@ $query = '
|
||||
anrechnung.dms_id,
|
||||
anrechnung.studiensemester_kurzbz,
|
||||
stg.studiengang_kz,
|
||||
stg.bezeichnung AS "stg_bezeichnung",
|
||||
stg.bezeichnung AS stg_bezeichnung,
|
||||
lv.orgform_kurzbz,
|
||||
(SELECT ausbildungssemester
|
||||
FROM public.tbl_prestudentstatus press
|
||||
WHERE press.prestudent_id = anrechnung.prestudent_id
|
||||
AND press.studiensemester_kurzbz = anrechnung.studiensemester_kurzbz
|
||||
AND press.status_kurzbz = \'Student\'),
|
||||
lv.bezeichnung AS "lv_bezeichnung",
|
||||
lv.ects,
|
||||
AND press.status_kurzbz = \'Student\'
|
||||
ORDER BY press.datum DESC
|
||||
LIMIT 1
|
||||
),
|
||||
lv.bezeichnung AS lv_bezeichnung,
|
||||
lv.ects::numeric(4,1),
|
||||
get_ects_summe_schulisch(student.student_uid, anrechnung.prestudent_id, stg.studiengang_kz) AS ectsSumSchulisch,
|
||||
get_ects_summe_beruflich(student.student_uid) AS ectsSumBeruflich,
|
||||
(person.nachname || \' \' || person.vorname) AS "student",
|
||||
begruendung.bezeichnung AS "begruendung",
|
||||
dmsversion.name AS "dokument_bezeichnung",
|
||||
@@ -46,7 +51,9 @@ $query = '
|
||||
WHERE anrechnung_id = anrechnung.anrechnung_id
|
||||
ORDER BY insertamum DESC
|
||||
LIMIT 1
|
||||
) AS status_kurzbz
|
||||
) AS status_kurzbz,
|
||||
student.student_uid,
|
||||
anrechnung.prestudent_id
|
||||
FROM lehre.tbl_anrechnung AS anrechnung
|
||||
JOIN public.tbl_prestudent USING (prestudent_id)
|
||||
JOIN public.tbl_person AS person USING (person_id)
|
||||
@@ -55,44 +62,69 @@ $query = '
|
||||
LEFT JOIN campus.tbl_dms_version AS dmsversion USING (dms_id)
|
||||
JOIN lehre.tbl_anrechnung_anrechnungstatus USING (anrechnung_id)
|
||||
JOIN lehre.tbl_anrechnung_begruendung AS begruendung USING (begruendung_id)
|
||||
JOIN public.tbl_student student USING (prestudent_id)
|
||||
WHERE anrechnung.studiensemester_kurzbz = \'' . $STUDIENSEMESTER . '\'
|
||||
AND stg.studiengang_kz IN (' . $STUDIENGAENGE_ENTITLED . ')
|
||||
)
|
||||
|
||||
SELECT anrechnungen.*,
|
||||
array_to_json(anrechnungstatus.bezeichnung_mehrsprachig::varchar[])->>' . $LANGUAGE_INDEX . ' AS "status_bezeichnung",
|
||||
CASE
|
||||
WHEN (anrechnungen.empfehlung_anrechnung IS NULL AND anrechnungen.status_kurzbz = \'' . ANRECHNUNGSTATUS_PROGRESSED_BY_STGL . '\') THEN NULL
|
||||
ELSE
|
||||
(SELECT insertamum::date
|
||||
FROM lehre.tbl_anrechnungstatus
|
||||
JOIN lehre.tbl_anrechnung_anrechnungstatus USING (status_kurzbz)
|
||||
WHERE anrechnung_id = anrechnungen.anrechnung_id
|
||||
AND status_kurzbz = \'' . ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR . '\'
|
||||
ORDER BY insertamum DESC
|
||||
LIMIT 1)
|
||||
END "empfehlungsanfrageAm",
|
||||
CASE
|
||||
WHEN (anrechnungen.empfehlung_anrechnung IS NULL AND anrechnungen.status_kurzbz = \'' . ANRECHNUNGSTATUS_PROGRESSED_BY_STGL . '\') THEN NULL
|
||||
ELSE
|
||||
(SELECT COALESCE(
|
||||
STRING_AGG(CONCAT_WS(\' \', vorname, nachname), \', \') FILTER (WHERE lvleiter = TRUE),
|
||||
STRING_AGG(CONCAT_WS(\' \', vorname, nachname), \', \') FILTER (WHERE lvleiter = FALSE)
|
||||
) empfehlungsanfrageAn
|
||||
FROM (
|
||||
SELECT DISTINCT ON (benutzer.uid) uid, vorname, nachname,
|
||||
CASE WHEN lehrfunktion_kurzbz = \'LV-Leitung\' THEN TRUE ELSE FALSE END AS lvleiter
|
||||
FROM lehre.tbl_lehreinheit
|
||||
JOIN lehre.tbl_lehreinheitmitarbeiter lema USING (lehreinheit_id)
|
||||
JOIN public.tbl_benutzer benutzer ON lema.mitarbeiter_uid = benutzer.uid
|
||||
JOIN public.tbl_person USING (person_id)
|
||||
WHERE studiensemester_kurzbz = \'' . $STUDIENSEMESTER . '\'
|
||||
AND lehrveranstaltung_id = anrechnungen.lehrveranstaltung_id
|
||||
AND lema.mitarbeiter_uid NOT like \'_Dummy%\'
|
||||
AND benutzer.aktiv = TRUE
|
||||
AND tbl_person.aktiv = TRUE
|
||||
ORDER BY benutzer.uid, lvleiter DESC, nachname, vorname
|
||||
) as tmp_lvlektoren
|
||||
)
|
||||
END "empfehlungsanfrageAn"
|
||||
|
||||
SELECT anrechnungen.anrechnung_id,
|
||||
anrechnungen.lehrveranstaltung_id,
|
||||
anrechnungen.begruendung_id,
|
||||
anrechnungen.dms_id,
|
||||
anrechnungen.studiensemester_kurzbz,
|
||||
anrechnungen.studiengang_kz,
|
||||
anrechnungen.stg_bezeichnung,
|
||||
anrechnungen.orgform_kurzbz,
|
||||
anrechnungen.ausbildungssemester,
|
||||
anrechnungen.lv_bezeichnung,
|
||||
anrechnungen.ects::float4 AS ects,
|
||||
NULL AS "ectsSumBisherUndNeu",
|
||||
anrechnungen.ectsSumSchulisch::float4 AS "ectsSumSchulisch",
|
||||
anrechnungen.ectsSumBeruflich::float4 AS "ectsSumBeruflich",
|
||||
anrechnungen.begruendung,
|
||||
anrechnungen.student,
|
||||
anrechnungen.dokument_bezeichnung,
|
||||
anrechnungen.anmerkung_student,
|
||||
anrechnungen.zgv,
|
||||
anrechnungen.antragsdatum,
|
||||
anrechnungen.empfehlung_anrechnung,
|
||||
anrechnungen.status_kurzbz,
|
||||
array_to_json(anrechnungstatus.bezeichnung_mehrsprachig::varchar[])->>' . $LANGUAGE_INDEX . ' AS "status_bezeichnung",
|
||||
anrechnungen.prestudent_id,
|
||||
CASE
|
||||
WHEN (anrechnungen.empfehlung_anrechnung IS NULL AND anrechnungen.status_kurzbz = \'' . ANRECHNUNGSTATUS_PROGRESSED_BY_STGL . '\') THEN NULL
|
||||
ELSE
|
||||
(SELECT insertamum::date
|
||||
FROM lehre.tbl_anrechnungstatus
|
||||
JOIN lehre.tbl_anrechnung_anrechnungstatus USING (status_kurzbz)
|
||||
WHERE anrechnung_id = anrechnungen.anrechnung_id
|
||||
AND status_kurzbz = \'' . ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR . '\'
|
||||
ORDER BY insertamum DESC
|
||||
LIMIT 1)
|
||||
END "empfehlungsanfrageAm",
|
||||
CASE
|
||||
WHEN (anrechnungen.empfehlung_anrechnung IS NULL AND anrechnungen.status_kurzbz = \'' . ANRECHNUNGSTATUS_PROGRESSED_BY_STGL . '\') THEN NULL
|
||||
ELSE
|
||||
(SELECT COALESCE(
|
||||
STRING_AGG(CONCAT_WS(\' \', vorname, nachname), \', \') FILTER (WHERE lvleiter = TRUE),
|
||||
STRING_AGG(CONCAT_WS(\' \', vorname, nachname), \', \') FILTER (WHERE lvleiter = FALSE)
|
||||
) empfehlungsanfrageAn
|
||||
FROM (
|
||||
SELECT DISTINCT ON (benutzer.uid) uid, vorname, nachname,
|
||||
CASE WHEN lehrfunktion_kurzbz = \'LV-Leitung\' THEN TRUE ELSE FALSE END AS lvleiter
|
||||
FROM lehre.tbl_lehreinheit
|
||||
JOIN lehre.tbl_lehreinheitmitarbeiter lema USING (lehreinheit_id)
|
||||
JOIN public.tbl_benutzer benutzer ON lema.mitarbeiter_uid = benutzer.uid
|
||||
JOIN public.tbl_person USING (person_id)
|
||||
WHERE studiensemester_kurzbz = \'' . $STUDIENSEMESTER . '\'
|
||||
AND lehrveranstaltung_id = anrechnungen.lehrveranstaltung_id
|
||||
AND lema.mitarbeiter_uid NOT like \'_Dummy%\'
|
||||
AND benutzer.aktiv = TRUE
|
||||
AND tbl_person.aktiv = TRUE
|
||||
ORDER BY benutzer.uid, lvleiter DESC, nachname, vorname
|
||||
) as tmp_lvlektoren
|
||||
)
|
||||
END "empfehlungsanfrageAn"
|
||||
FROM anrechnungen
|
||||
JOIN lehre.tbl_anrechnungstatus as anrechnungstatus ON (anrechnungstatus.status_kurzbz = anrechnungen.status_kurzbz)
|
||||
WHERE studiensemester_kurzbz = \'' . $STUDIENSEMESTER . '\'
|
||||
@@ -115,9 +147,12 @@ $filterWidgetArray = array(
|
||||
ucfirst($this->p->t('lehre', 'organisationsform')),
|
||||
'Semester',
|
||||
ucfirst($this->p->t('lehre', 'lehrveranstaltung')),
|
||||
'ECTS',
|
||||
ucfirst($this->p->t('person', 'studentIn')),
|
||||
'ECTS (LV)',
|
||||
'ECTS (LV + Bisher)',
|
||||
'ECTS (Bisher schulisch)',
|
||||
'ECTS (Bisher beruflich',
|
||||
ucfirst($this->p->t('global', 'begruendung')),
|
||||
ucfirst($this->p->t('person', 'studentIn')),
|
||||
ucfirst($this->p->t('anrechnung', 'nachweisdokumente')),
|
||||
ucfirst($this->p->t('anrechnung', 'herkunft')),
|
||||
ucfirst($this->p->t('global', 'zgv')),
|
||||
@@ -125,6 +160,7 @@ $filterWidgetArray = array(
|
||||
ucfirst($this->p->t('anrechnung', 'empfehlung')),
|
||||
'status_kurzbz',
|
||||
'Status',
|
||||
'PrestudentID',
|
||||
ucfirst($this->p->t('anrechnung', 'empfehlungsanfrageAm')),
|
||||
ucfirst($this->p->t('anrechnung', 'empfehlungsanfrageAn'))
|
||||
),
|
||||
@@ -152,8 +188,8 @@ $filterWidgetArray = array(
|
||||
rowFormatter:function(row){
|
||||
func_rowFormatter(row);
|
||||
},
|
||||
rowUpdated:function(row){
|
||||
func_rowUpdated(row);
|
||||
rowSelectionChanged:function(data, rows){
|
||||
func_rowSelectionChanged(data, rows);
|
||||
},
|
||||
tooltips: function(cell){
|
||||
return func_tooltips(cell);
|
||||
@@ -171,8 +207,11 @@ $filterWidgetArray = array(
|
||||
ausbildungssemester: {headerFilter:"input"},
|
||||
lv_bezeichnung: {headerFilter:"input"},
|
||||
ects: {headerFilter:"input", align:"center"},
|
||||
ectsSumBisherUndNeu: {formatter: format_ectsSumBisherUndNeu},
|
||||
ectsSumSchulisch: {visible: false, headerFilter:"input", align:"right"},
|
||||
ectsSumBeruflich: {visible: false, headerFilter:"input", align:"right"},
|
||||
begruendung: {headerFilter:"input", visible: true},
|
||||
student: {headerFilter:"input"},
|
||||
begruendung: {headerFilter:"input"},
|
||||
zgv: {visible: false, headerFilter:"input"},
|
||||
dokument_bezeichnung: {headerFilter:"input", formatter:"link", formatterParams:{
|
||||
labelField:"dokument_bezeichnung",
|
||||
@@ -184,6 +223,7 @@ $filterWidgetArray = array(
|
||||
empfehlung_anrechnung: {headerFilter:"input", align:"center", formatter: format_empfehlung_anrechnung, headerFilterFunc: hf_filterTrueFalse},
|
||||
status_kurzbz: {visible: false, headerFilter:"input"},
|
||||
status_bezeichnung: {headerFilter:"input"},
|
||||
prestudent_id: {visible: false, headerFilter:"input"},
|
||||
empfehlungsanfrageAm: {visible: false, align:"center", headerFilter:"input", mutator: mut_formatStringDate},
|
||||
empfehlungsanfrageAn: {visible: false, headerFilter:"input"}
|
||||
}', // col properties
|
||||
@@ -191,4 +231,4 @@ $filterWidgetArray = array(
|
||||
|
||||
echo $this->widgetlib->widget('TableWidget', $filterWidgetArray);
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -38,7 +38,6 @@ $this->load->view(
|
||||
);
|
||||
?>
|
||||
|
||||
<body>
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
|
||||
@@ -170,4 +169,5 @@ $this->load->view(
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
|
||||
@@ -26,11 +26,14 @@ $this->load->view(
|
||||
'neu',
|
||||
'maxZeichen',
|
||||
'errorBestaetigungFehlt',
|
||||
'systemfehler'
|
||||
'systemfehler',
|
||||
'errorDokumentZuGross'
|
||||
),
|
||||
'anrechnung' => array(
|
||||
'deadlineUeberschritten',
|
||||
'benotungDerLV'
|
||||
'benotungDerLV',
|
||||
'anrechnungEctsTextBeiUeberschreitung',
|
||||
'anrechnungEctsTooltipTextBeiUeberschreitung'
|
||||
),
|
||||
'person' => array(
|
||||
'student',
|
||||
@@ -59,7 +62,6 @@ $this->load->view(
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<!-- header -->
|
||||
@@ -79,9 +81,13 @@ $this->load->view(
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<form id="requestAnrechnung-form">
|
||||
<input type="hidden" name="anrechnung_id" id="anrechnung_id" value="<?php echo $anrechnungData->anrechnung_id ?>">
|
||||
<input type="hidden" name="lv_id" value="<?php echo $antragData->lv_id ?>">
|
||||
<input type="hidden" name="studiensemester" value="<?php echo $antragData->studiensemester_kurzbz ?>">
|
||||
<!-- Antragsdaten -->
|
||||
<input type="hidden" name="ects" value="<?php echo $antragData->ects ?>">
|
||||
<input type="hidden" name="sumEctsSchulisch" value="<?php echo $antragData->sumEctsSchulisch ?>">
|
||||
<input type="hidden" name="sumEctsBeruflich" value="<?php echo $antragData->sumEctsBeruflich ?>">
|
||||
<!-- Antragsdaten -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
@@ -118,8 +124,23 @@ $this->load->view(
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $this->p->t('lehre', 'ects'); ?></th>
|
||||
<td><?php echo $antragData->ects ?></td>
|
||||
<td><span id="ects"><?php echo number_format($antragData->ects, 1) ?> ECTS</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<?php echo $this->p->t('anrechnung', 'bisherAngerechneteEcts'); ?>
|
||||
<span data-toggle="tooltip" data-placement="right"
|
||||
title="<?php echo $this->p->t('anrechnung', 'anrechnungEctsTooltipText'); ?>">
|
||||
<i class="fa fa-lg fa-info-circle" aria-hidden="true"></i>
|
||||
</span>
|
||||
</th>
|
||||
<td colspan="3">
|
||||
Total ECTS: <span id="sumEctsTotal"><?php echo number_format($antragData->sumEctsSchulisch + $antragData->sumEctsBeruflich, 1) ?></span>
|
||||
[ Schulisch: <span id="sumEctsSchulisch"><?php echo $antragData->sumEctsSchulisch ?></span> |
|
||||
Beruflich: <span id="sumEctsBeruflich"><?php echo $antragData->sumEctsBeruflich ?></span> ]
|
||||
<span id="requestAnrechnung-maxEctsUeberschrittenMsg"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo ucfirst($this->p->t('lehre', 'lektorInnen')); ?></th>
|
||||
<td>
|
||||
@@ -151,6 +172,17 @@ $this->load->view(
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="radio" name="begruendung" value="5" required
|
||||
<?php echo $anrechnungData->begruendung_id == '5' ? 'checked' : ''; ?> />
|
||||
<?php echo $this->p->t('anrechnung', 'antragStellenWegenHochschulzeugnis'); ?> 
|
||||
<span id="requestAnrechnung-anrechnungGrundHochschulzeugnisTooltip" data-toggle="tooltip" data-placement="right"
|
||||
title="<?php echo $this->p->t('anrechnung', 'anrechnungGrundZeugnisTooltipText'); ?>" />
|
||||
<i class="fa fa-lg fa-info-circle" aria-hidden="true"></i>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="radio" name="begruendung" value="4" required
|
||||
@@ -179,7 +211,7 @@ $this->load->view(
|
||||
<div class="form-inline panel-body">
|
||||
<div class="form-group">
|
||||
<input type="file" id="requestAnrechnung-uploadfile"
|
||||
name="uploadfile" accept=".pdf" size="50"
|
||||
name="uploadfile" accept=".pdf" size="50" data-maxsize="<?php echo (int)ini_get('upload_max_filesize') * 1024 * 1024 ?>"
|
||||
required>
|
||||
</div>
|
||||
<span id="requestAnrechnung-uploadTooltip" data-toggle="tooltip" data-placement="right"
|
||||
@@ -260,6 +292,5 @@ $this->load->view(
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
|
||||
@@ -52,7 +52,6 @@ $this->load->view(
|
||||
);
|
||||
?>
|
||||
|
||||
<body>
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<!-- title -->
|
||||
@@ -225,31 +224,29 @@ $this->load->view(
|
||||
<div class="panel panel-default panel-body" style="display: none" id="reviewAnrechnungDetail-begruendung-panel">
|
||||
<div>
|
||||
<h4 class="panel panel-body panel-danger text-danger"><?php echo $this->p->t('anrechnung', 'empfehlungNegativQuestion'); ?></h4>
|
||||
 
|
||||
<b> <?php echo $this->p->t('anrechnung', 'bitteBegruendungAngeben'); ?></b><br><br>
|
||||
<ul>
|
||||
<li>
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
<span><?php echo $this->p->t('anrechnung', 'empfehlungNegativPruefungNichtMoeglich'); ?></span> 
|
||||
<span class="btn-copyIntoTextarea" data-toggle="tooltip"
|
||||
<span class="btn-copyIntoTextarea pull-right" data-toggle="tooltip"
|
||||
data-placement="right"
|
||||
title="<?php echo $this->p->t('ui', 'textUebernehmen'); ?>">
|
||||
<i class="fa fa-clipboard" aria-hidden="true"></i>
|
||||
<i class="fa fa-clipboard fa-lg" aria-hidden="true"></i>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<li class="list-group-item">
|
||||
<span><?php echo $this->p->t('anrechnung', 'empfehlungNegativKenntnisseNichtGleichwertig'); ?></span> 
|
||||
<span class="btn-copyIntoTextarea" data-toggle="tooltip"
|
||||
<span class="btn-copyIntoTextarea pull-right" data-toggle="tooltip"
|
||||
data-placement="right"
|
||||
title="<?php echo $this->p->t('ui', 'textUebernehmen'); ?>">
|
||||
<i class="fa fa-clipboard" aria-hidden="true"></i>
|
||||
<i class="fa fa-clipboard fa-lg" aria-hidden="true"></i>
|
||||
</span>
|
||||
</li>
|
||||
<li><?php echo $this->p->t('anrechnung', 'andereBegruendung'); ?></li>
|
||||
</ul>
|
||||
<br>
|
||||
<textarea class="form-control" name="begruendung"
|
||||
id="reviewAnrechnungDetail-begruendung"
|
||||
rows="2" required></textarea>
|
||||
rows="2"
|
||||
placeholder="<?php echo $this->p->t('anrechnung', 'textUebernehmenOderEigenenBegruendungstext'); ?>"
|
||||
required></textarea>
|
||||
</div>
|
||||
<br>
|
||||
<!-- Button Abbrechen & Bestaetigen-->
|
||||
@@ -318,6 +315,5 @@ $this->load->view(
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
|
||||
@@ -80,7 +80,6 @@ $this->load->view(
|
||||
);
|
||||
?>
|
||||
|
||||
<body>
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<!-- title -->
|
||||
@@ -127,30 +126,31 @@ $this->load->view(
|
||||
id="reviewAnrechnungUebersicht-begruendung-panel">
|
||||
<div>
|
||||
<h4 class="panel panel-body panel-danger text-danger"><?php echo $this->p->t('anrechnung', 'empfehlungenNegativQuestion'); ?></h4>
|
||||
<b> <?php echo $this->p->t('anrechnung', 'bitteBegruendungAngeben'); ?></b><br><br>
|
||||
<ul>
|
||||
<li>
|
||||
<span><?php echo $this->p->t('anrechnung', 'empfehlungNegativPruefungNichtMoeglich'); ?></span>
|
||||
<span class="btn-copyIntoTextarea" data-toggle="tooltip" data-placement="right"
|
||||
title="<?php echo $this->p->t('ui', 'textUebernehmen'); ?>">
|
||||
<i class="fa fa-clipboard" aria-hidden="true"></i>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span><?php echo $this->p->t('anrechnung', 'empfehlungNegativKenntnisseNichtGleichwertig'); ?></span>
|
||||
<span class="btn-copyIntoTextarea" data-toggle="tooltip" data-placement="right"
|
||||
title="<?php echo $this->p->t('ui', 'textUebernehmen'); ?>">
|
||||
<i class="fa fa-clipboard" aria-hidden="true"></i>
|
||||
</span>
|
||||
</li>
|
||||
<li><?php echo $this->p->t('anrechnung', 'andereBegruendung'); ?></li>
|
||||
</ul>
|
||||
<br>
|
||||
<span class="text-danger">
|
||||
<b><span> <?php echo $this->p->t('anrechnung', 'bitteBegruendungAngeben'); ?></span>
|
||||
<span class="text-danger">
|
||||
<?php echo $this->p->t('anrechnung', 'begruendungWirdFuerAlleUebernommen'); ?>
|
||||
</span><br><br>
|
||||
</span></b>
|
||||
<br><br>
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
<span><?php echo $this->p->t('anrechnung', 'empfehlungNegativPruefungNichtMoeglich'); ?></span>
|
||||
<span class="btn-copyIntoTextarea pull-right" data-toggle="tooltip" data-placement="right"
|
||||
title="<?php echo $this->p->t('ui', 'textUebernehmen'); ?>">
|
||||
<i class="fa fa-clipboard fa-lg" aria-hidden="true"></i>
|
||||
</span>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<span><?php echo $this->p->t('anrechnung', 'empfehlungNegativKenntnisseNichtGleichwertig'); ?></span>
|
||||
<span class="btn-copyIntoTextarea pull-right" data-toggle="tooltip" data-placement="right"
|
||||
title="<?php echo $this->p->t('ui', 'textUebernehmen'); ?>">
|
||||
<i class="fa fa-clipboard fa-lg" aria-hidden="true"></i>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<textarea class="form-control" name="begruendung" id="reviewAnrechnungUebersicht-begruendung"
|
||||
rows="2" required></textarea>
|
||||
rows="2"
|
||||
placeholder="<?php echo $this->p->t('anrechnung', 'textUebernehmenOderEigenenBegruendungstext'); ?>"
|
||||
required></textarea>
|
||||
</div>
|
||||
<br>
|
||||
<!-- Action Button Abbrechen & Bestaetigen-->
|
||||
@@ -235,7 +235,6 @@ $this->load->view(
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ FROM
|
||||
(SELECT
|
||||
uid
|
||||
FROM
|
||||
public.tbl_benutzer JOIN public.tbl_mitarbeiter ma
|
||||
public.tbl_benutzer JOIN public.tbl_mitarbeiter ma
|
||||
ON tbl_benutzer.uid = ma.mitarbeiter_uid
|
||||
WHERE
|
||||
person_id = tmp_projektbetreuung.person_id
|
||||
@@ -268,7 +268,7 @@ FROM
|
||||
ELSE (oe.organisationseinheittyp_kurzbz ||
|
||||
\' \' || oe.bezeichnung)
|
||||
END AS "lv_oe_kurzbz",
|
||||
(vorname || \' \' || nachname) AS "lektor",
|
||||
(nachname || \' \' || vorname) AS "lektor",
|
||||
TRUNC(pb.stunden, 1) AS "stunden",
|
||||
TRUNC((pb.stunden * pb.stundensatz), 2) AS "betrag",
|
||||
vertrag_id,
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
<?php
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'Zeitverfuegbarkeit verwalten',
|
||||
'jquery' => true,
|
||||
'jqueryui' => true,
|
||||
'bootstrap' => true,
|
||||
'fontawesome' => true,
|
||||
'momentjs' => true,
|
||||
'ajaxlib' => true,
|
||||
'tabulator' => true,
|
||||
'tablewidget' => true,
|
||||
'navigationwidget' => true,
|
||||
'sbadmintemplate' => true,
|
||||
'phrases' => array(
|
||||
'global' => array(
|
||||
'bis',
|
||||
'notiz'
|
||||
),
|
||||
'ui' => array(
|
||||
'systemfehler',
|
||||
'keineDatenVorhanden',
|
||||
'von',
|
||||
'bitteWaehlen',
|
||||
'speichern',
|
||||
'loeschen',
|
||||
'abbrechen'
|
||||
),
|
||||
'lehre' => array(
|
||||
'lektor'
|
||||
)
|
||||
),
|
||||
'widgets' => true,
|
||||
'dialoglib' => true,
|
||||
'customJSs' => array(
|
||||
'public/js/bootstrapper.js',
|
||||
'public/js/lehre/lvplanung/zverfueg.js'
|
||||
)
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
<body>
|
||||
<?php echo $this->widgetlib->widget('NavigationWidget'); ?>
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- title -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12 page-header">
|
||||
<h3>Zeitverfügbarkeiten verwalten<small> | Punktuelle Zeitverfügbarkeiten von Lehrenden für die LV-Planung verwalten</small></h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- form -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<form id="form-zeitverfuegbarkeit" class="form-horizontal">
|
||||
<input type="hidden" id="studsemStart" value="<?php echo $studsemStart ?>">
|
||||
<input type="hidden" id="zeitsperre_id" name="zeitsperre_id" value="">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="mitarbeiter_uid" class="col-sm-1 control-label">LektorIn: </label>
|
||||
<div class="col-sm-3">
|
||||
<select id="mitarbeiter_uid" name="mitarbeiter_uid" class="form-control select-w500" required>
|
||||
<option value="" >
|
||||
<?php echo $this->p->t('ui', 'bitteWaehlen'); ?>
|
||||
</option>
|
||||
<?php foreach ($lektor_arr as $lektor) : ?>
|
||||
<option value="<?php echo $lektor->mitarbeiter_uid ?>">
|
||||
<?php echo $lektor->nachname. ' '. $lektor->vorname ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="zverfueg" class="col-sm-1 control-label">Grund: </label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" id="zeitsperretyp_kurzbz" value="Zeitverfügbarkeit" name="zeitsperretyp_kurzbz" readonly />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="bezeichnung" class="col-sm-1 control-label">Notiz: </label>
|
||||
<div class="col-sm-3">
|
||||
<textarea type="" id="bezeichnung" name="bezeichnung" value="" required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="vondatum" class="col-sm-1 control-label">Von: </label>
|
||||
<div class="col-sm-3">
|
||||
<input type="date" id="vondatum" name="vondatum" class="form-control zverfueg-datepicker" required>
|
||||
</div>
|
||||
<label for="vonstunde" class="col-sm-1 control-label">Stunde (inkl.): </label>
|
||||
<div class="col-sm-3">
|
||||
<select id="vonstunde" name="vonstunde" class="form-control select-w500">
|
||||
<option value="" >*</option>
|
||||
<?php foreach ($stunde_arr as $stunde) : ?>
|
||||
<option value="<?php echo $stunde->stunde ?>">
|
||||
<?php echo $stunde->stunde.
|
||||
' ['.
|
||||
(new DateTime($stunde->beginn))->format('H:i'). ' - '.
|
||||
(new DateTime($stunde->ende))->format('H:i').
|
||||
']' ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="bisdatum" class="col-sm-1 control-label">Bis: </label>
|
||||
<div class="col-sm-3">
|
||||
<input type="date" id="bisdatum" name="bisdatum" class="form-control zverfueg-datepicker" required>
|
||||
</div>
|
||||
<label for="bisstunde" class="col-sm-1 control-label">Stunde (inkl.): </label>
|
||||
<div class="col-sm-3">
|
||||
<select id="bisstunde" name="bisstunde" class="form-control select-w500">
|
||||
<option value="" >*</option>
|
||||
<?php foreach ($stunde_arr as $stunde) : ?>
|
||||
<option value="<?php echo $stunde->stunde ?>">
|
||||
<?php echo $stunde->stunde.
|
||||
' ['.
|
||||
(new DateTime($stunde->beginn))->format('H:i'). ' - '.
|
||||
(new DateTime($stunde->ende))->format('H:i').
|
||||
']' ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-8">
|
||||
<button type="submit" id="btn-save" class="btn btn-primary btn-w200 pull-right">
|
||||
<?php echo ucfirst($this->p->t('ui', 'speichern')); ?>
|
||||
</button>
|
||||
<button type="button" id="btn-delete" class="btn btn-danger btn-w200 btn-mr5 pull-right" disabled
|
||||
data-toggle="tooltip" data-placement="right"
|
||||
title="Zum Löschen LektorIn aus Tabelle wählen">
|
||||
<?php echo ucfirst($this->p->t('ui', 'loeschen')); ?>
|
||||
</button>
|
||||
<button type="reset" id="btn-break" class="btn btn-default btn-w200 btn-mr5 pull-right">
|
||||
<?php echo ucfirst($this->p->t('ui', 'abbrechen')); ?>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- data table -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<?php $this->load->view('lehre/lvplanung/adminZeitverfuegbarkeitData.php'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!-- end container -->
|
||||
</div><!-- end page-wrapper -->
|
||||
<br>
|
||||
</body>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
$STUDIENGANG_KZ_ARR = $studiengang_kz_arr; // stg the user is entitled to administrate
|
||||
|
||||
$qry = '
|
||||
SELECT * FROM (
|
||||
SELECT DISTINCT ON (zeitsperre_id, zsp.mitarbeiter_uid) zeitsperre_id, zsp.mitarbeiter_uid,
|
||||
concat_ws(\' \', nachname, vorname) AS "lektor",
|
||||
vondatum, vonstunde, bisdatum, bisstunde, zsp.bezeichnung
|
||||
FROM public.tbl_person
|
||||
JOIN public.tbl_benutzer b USING (person_id)
|
||||
JOIN public.tbl_mitarbeiter ma ON (ma.mitarbeiter_uid = b.uid)
|
||||
JOIN lehre.tbl_lehreinheitmitarbeiter lema ON (lema.mitarbeiter_uid = b.uid)
|
||||
JOIN lehre.tbl_lehreinheit le USING (lehreinheit_id)
|
||||
JOIN lehre.tbl_lehrveranstaltung lv USING (lehrveranstaltung_id)
|
||||
JOIN public.tbl_studiensemester ss USING (studiensemester_kurzbz)
|
||||
JOIN campus.tbl_zeitsperre zsp ON zsp.mitarbeiter_uid = lema.mitarbeiter_uid
|
||||
WHERE lv.studiengang_kz IN ('. implode (',', $STUDIENGANG_KZ_ARR). ')
|
||||
AND b.aktiv
|
||||
AND zsp.vondatum >= ss.start
|
||||
AND zeitsperretyp_kurzbz = \'ZVerfueg\'
|
||||
ORDER BY zeitsperre_id, zsp.mitarbeiter_uid
|
||||
) as tmp
|
||||
ORDER BY vondatum DESC
|
||||
';
|
||||
|
||||
$filterWidgetArray = array(
|
||||
'query' => $qry,
|
||||
'tableUniqueId' => 'adminZeitverfuegbarkeit',
|
||||
'requiredPermissions' => 'lehre/zeitverfuegbarkeit',
|
||||
'datasetRepresentation' => 'tabulator',
|
||||
'columnsAliases' => array(
|
||||
'ZeitsperreID',
|
||||
'UID',
|
||||
ucfirst($this->p->t('lehre', 'lektor')),
|
||||
ucfirst($this->p->t('ui', 'von')),
|
||||
'VonStunde',
|
||||
ucfirst($this->p->t('global', 'bis')),
|
||||
'BisStunde',
|
||||
ucfirst($this->p->t('global', 'notiz'))
|
||||
),
|
||||
'datasetRepOptions' => '{
|
||||
layout: "fitColumns", // fit columns to width of table
|
||||
autoResize: false, // prevent auto resizing of table (false to allow adapting table size when cols are (de-)activated
|
||||
headerFilterPlaceholder: " ",
|
||||
index: "zeitsperre_id", // assign specific column as unique id (important for row indexing)
|
||||
selectable: 1, // allow row selection
|
||||
tableWidgetHeader: false,
|
||||
rowSelected: function(row) {
|
||||
func_rowSelected(row);
|
||||
},
|
||||
rowDeselected: function(row) {
|
||||
func_rowDeselected(row);
|
||||
}
|
||||
}', // tabulator properties
|
||||
'datasetRepFieldsDefs' => '{
|
||||
zeitsperre_id: {visible:false},
|
||||
mitarbeiter_uid: {visible: true, headerFilter:"input"},
|
||||
lektor: {visible: true, headerFilter:"input"},
|
||||
vondatum: {visible: true, headerFilter:"input"},
|
||||
vonstunde: {visible: true, headerFilter:"input"},
|
||||
bisdatum: {visible: true, headerFilter:"input"},
|
||||
bisstunde: {visible: true, headerFilter:"input"},
|
||||
bezeichnung: {visible: true, headerFilter:"input"}
|
||||
}', // col properties
|
||||
);
|
||||
|
||||
echo $this->widgetlib->widget('TableWidget', $filterWidgetArray);
|
||||
|
||||
?>
|
||||
@@ -3,7 +3,8 @@
|
||||
'query' => '
|
||||
SELECT
|
||||
person_id, vorname, nachname, geschlecht, svnr, ersatzkennzeichen, matr_nr,
|
||||
staatsbuergerschaft, gebdatum, false AS mitarbeiter
|
||||
staatsbuergerschaft, gebdatum, false AS mitarbeiter,
|
||||
(SELECT count(*) FROM public.tbl_akte WHERE person_id=tbl_person.person_id) AS anzahl_dokumente
|
||||
FROM
|
||||
public.tbl_person
|
||||
WHERE
|
||||
@@ -14,7 +15,8 @@
|
||||
UNION
|
||||
SELECT
|
||||
person_id, vorname, nachname, geschlecht, svnr, ersatzkennzeichen, matr_nr,
|
||||
staatsbuergerschaft, gebdatum, true AS mitarbeiter
|
||||
staatsbuergerschaft, gebdatum, true AS mitarbeiter,
|
||||
(SELECT count(*) FROM public.tbl_akte WHERE person_id=tbl_person.person_id) AS anzahl_dokumente
|
||||
FROM
|
||||
public.tbl_person
|
||||
JOIN public.tbl_benutzer USING(person_id)
|
||||
@@ -36,7 +38,8 @@
|
||||
ucfirst($this->p->t('person', 'matrikelnummer')),
|
||||
ucfirst($this->p->t('person', 'staatsbuergerschaft')),
|
||||
ucfirst($this->p->t('person', 'geburtsdatum')),
|
||||
'Mitarbeiter'
|
||||
'Mitarbeiter',
|
||||
'Anzahl Dokumente'
|
||||
),
|
||||
'formatRow' => function($datasetRaw) {
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<a href="outputAkteContent/<?php echo $dokument->akte_id ?>"><?php echo isEmptyString($dokument->titel) ? $dokument->bezeichnung : $dokument->titel ?></a>
|
||||
</td>
|
||||
<td>
|
||||
<select class="aktenid" id="aktenid_<?php echo $dokument->akte_id?>" <?php echo (isset($formalReadonly) ? 'disabled' : '') ?>>
|
||||
<select class="aktenid" id="aktenid_<?php echo $dokument->akte_id?>" <?php echo (isset($formalReadonly) ? 'disabled' : '') ?> autocomplete="off">
|
||||
<?php
|
||||
foreach($dokumententypen as $dokumenttyp)
|
||||
echo "<option " . ($dokumenttyp->bezeichnung === $dokument->dokument_bezeichnung ? 'selected' : '') . " value = " . $dokumenttyp->dokument_kurzbz . ">" . $dokumenttyp->bezeichnung . "</option>"
|
||||
@@ -65,7 +65,7 @@
|
||||
if (!isset($formalReadonly)) :
|
||||
?>
|
||||
<td>
|
||||
<input type="checkbox" class="form-check-input prchbox"
|
||||
<input type="checkbox" class="form-check-input prchbox" autocomplete="off"
|
||||
id="prchkbx_<?php echo $dokument->akte_id ?>" <?php echo $geprueft ?>>
|
||||
<span id="formalgeprueftam_<?php echo $dokument->akte_id ?>">
|
||||
<?php echo isset($dokument->formal_geprueft_amum) ? date_format(date_create($dokument->formal_geprueft_amum), 'd.m.Y') : ''; ?>
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'Info Center',
|
||||
'jquery' => true,
|
||||
'jqueryui' => true,
|
||||
'jquerycheckboxes' => true,
|
||||
'bootstrap' => true,
|
||||
'fontawesome' => true,
|
||||
'sbadmintemplate' => true,
|
||||
'tablesorter' => true,
|
||||
'ajaxlib' => true,
|
||||
'filterwidget' => true,
|
||||
'navigationwidget' => true,
|
||||
'dialoglib' => true,
|
||||
'phrases' => array(
|
||||
'person' => array('vorname', 'nachname'),
|
||||
'global' => array('mailAnXversandt'),
|
||||
'ui' => array('bitteEintragWaehlen')
|
||||
),
|
||||
'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/infocenter/infocenterPersonDataset.css'),
|
||||
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/infocenterPersonDataset.js')
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
|
||||
<?php echo $this->widgetlib->widget('NavigationWidget'); ?>
|
||||
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header">
|
||||
Abgewiesene
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<?php $this->load->view('system/infocenter/infocenterAbgewiesenData.php'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
$this->config->load('infocenter');
|
||||
$ABGEWIESENEN_STATUS = '\'Abgewiesener\'';
|
||||
$STUDIENGANG_TYP = '\''.$this->variablelib->getVar('infocenter_studiensgangtyp').'\'';
|
||||
$ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz');
|
||||
$STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\'';
|
||||
$LOGDATA_NAME = '\'Message sent\'';
|
||||
$LOGDATA_VON = '\'online\'';
|
||||
|
||||
$query = '
|
||||
SELECT
|
||||
p.person_id AS "PersonID",
|
||||
ps.prestudent_id AS "PreStudentID",
|
||||
p.vorname AS "Vorname",
|
||||
p.nachname AS "Nachname",
|
||||
so.studiengangkurzbzlang as "Studiengang",
|
||||
pss.insertamum AS "AbgewiesenAm",
|
||||
(
|
||||
SELECT l.zeitpunkt
|
||||
FROM system.tbl_log l
|
||||
WHERE l.person_id = p.person_id
|
||||
AND '. $LOGDATA_NAME .' = (
|
||||
SELECT l.logdata->>\'name\'
|
||||
FROM system.tbl_log l
|
||||
WHERE l.person_id = p.person_id
|
||||
ORDER BY l.log_id DESC
|
||||
LIMIT 1
|
||||
)
|
||||
AND '. $LOGDATA_VON .' = (
|
||||
SELECT l.insertvon
|
||||
FROM system.tbl_log l
|
||||
WHERE l.person_id = p.person_id
|
||||
ORDER BY l.log_id DESC
|
||||
LIMIT 1
|
||||
)
|
||||
AND l.zeitpunkt >= pss.insertamum
|
||||
ORDER BY l.log_id DESC
|
||||
LIMIT 1
|
||||
) AS "Nachricht"
|
||||
FROM
|
||||
public.tbl_prestudentstatus pss
|
||||
JOIN public.tbl_prestudent ps USING(prestudent_id)
|
||||
JOIN public.tbl_person p USING(person_id)
|
||||
JOIN public.tbl_studiengang sg USING(studiengang_kz)
|
||||
JOIN lehre.tbl_studienplan sp USING(studienplan_id)
|
||||
JOIN lehre.tbl_studienordnung so USING(studienordnung_id)
|
||||
WHERE pss.status_kurzbz = '. $ABGEWIESENEN_STATUS .'
|
||||
AND pss.studiensemester_kurzbz = '. $STUDIENSEMESTER .'
|
||||
AND (sg.typ IN ('. $STUDIENGANG_TYP .')
|
||||
OR
|
||||
sg.studiengang_kz IN ('. $ADDITIONAL_STG .')
|
||||
)
|
||||
ORDER BY "AbgewiesenAm" DESC';
|
||||
|
||||
$filterWidgetArray = array(
|
||||
'query' => $query,
|
||||
'app' => InfoCenter::APP,
|
||||
'datasetName' => 'abgewiesen',
|
||||
'filter_id' => $this->input->get('filter_id'),
|
||||
'requiredPermissions' => 'infocenter',
|
||||
'datasetRepresentation' => 'tablesorter',
|
||||
'columnsAliases' => array(
|
||||
'PersonID',
|
||||
'PreStudentID',
|
||||
'Vorname',
|
||||
'Nachname',
|
||||
'Studiengang',
|
||||
'Abgewiesen am',
|
||||
'Nachricht'
|
||||
),
|
||||
|
||||
'formatRow' => function($datasetRaw) {
|
||||
if ($datasetRaw->{'Nachricht'} === null)
|
||||
{
|
||||
$datasetRaw->{'Nachricht'} = 'Nein';
|
||||
}
|
||||
else
|
||||
{
|
||||
$datasetRaw->{'Nachricht'} = 'Ja';
|
||||
}
|
||||
|
||||
$datasetRaw->{'AbgewiesenAm'} = date_format(date_create($datasetRaw->{'AbgewiesenAm'}),'Y-m-d H:i');
|
||||
return $datasetRaw;
|
||||
}
|
||||
);
|
||||
|
||||
echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray);
|
||||
?>
|
||||
@@ -6,7 +6,7 @@
|
||||
$INTERESSENT_STATUS = '\'Interessent\'';
|
||||
$STUDIENGANG_TYP = '\''.$this->variablelib->getVar('infocenter_studiensgangtyp').'\'';
|
||||
$TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\'';
|
||||
$LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'Interessent rejected\'';
|
||||
$LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'Interessent rejected\', \'Attempt to register with existing mailadress\', \'Access code sent\', \'Personal data saved\'';
|
||||
$LOGDATA_NAME_PARKED = '\'Parked\'';
|
||||
$LOGDATA_NAME_ONHOLD = '\'Onhold\'';
|
||||
$LOGTYPE_KURZBZ = '\'Processstate\'';
|
||||
@@ -55,8 +55,10 @@
|
||||
a.dokument_kurzbz in ('.$AKTE_TYP.')
|
||||
) AS "AnzahlAkte",
|
||||
(
|
||||
SELECT l.insertvon
|
||||
SELECT CASE WHEN sp.nachname IS NULL THEN l.insertvon ELSE sp.nachname END
|
||||
FROM system.tbl_log l
|
||||
LEFT JOIN public.tbl_benutzer on l.insertvon = tbl_benutzer.uid
|
||||
LEFT JOIN public.tbl_person sp on tbl_benutzer.person_id = sp.person_id
|
||||
WHERE l.taetigkeit_kurzbz IN ('.$TAETIGKEIT_KURZBZ.')
|
||||
AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.')
|
||||
AND l.person_id = p.person_id
|
||||
@@ -135,11 +137,12 @@
|
||||
LIMIT 1
|
||||
) AS "AnzahlAbgeschickt",
|
||||
(
|
||||
SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(sg.typ || sg.kurzbz) || \':\' || sp.orgform_kurzbz), \', \')
|
||||
SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(so.studiengangkurzbzlang) || \':\' || sp.orgform_kurzbz), \', \')
|
||||
FROM public.tbl_prestudentstatus pss
|
||||
JOIN public.tbl_prestudent ps USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang sg USING(studiengang_kz)
|
||||
JOIN lehre.tbl_studienplan sp USING(studienplan_id)
|
||||
JOIN lehre.tbl_studienordnung so USING(studienordnung_id)
|
||||
WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.'
|
||||
AND pss.bewerbung_abgeschicktamum IS NOT NULL
|
||||
-- AND pss.bestaetigtam IS NULL
|
||||
@@ -160,11 +163,12 @@
|
||||
LIMIT 1
|
||||
) AS "StgAbgeschickt",
|
||||
(
|
||||
SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(sg.typ || sg.kurzbz) || \':\' || sp.orgform_kurzbz), \', \')
|
||||
SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(so.studiengangkurzbzlang) || \':\' || sp.orgform_kurzbz), \', \')
|
||||
FROM public.tbl_prestudentstatus pss
|
||||
JOIN public.tbl_prestudent ps USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang sg USING(studiengang_kz)
|
||||
JOIN lehre.tbl_studienplan sp USING(studienplan_id)
|
||||
JOIN lehre.tbl_studienordnung so USING(studienordnung_id)
|
||||
WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.'
|
||||
AND pss.bewerbung_abgeschicktamum IS NULL
|
||||
AND pss.bestaetigtam IS NULL
|
||||
@@ -212,11 +216,12 @@
|
||||
LIMIT 1
|
||||
) AS "AnzahlStgNichtAbgeschickt",
|
||||
(
|
||||
SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(sg.typ || sg.kurzbz) || \':\' || sp.orgform_kurzbz), \', \')
|
||||
SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(so.studiengangkurzbzlang) || \':\' || sp.orgform_kurzbz), \', \')
|
||||
FROM public.tbl_prestudentstatus pss
|
||||
JOIN public.tbl_prestudent ps USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang sg USING(studiengang_kz)
|
||||
JOIN lehre.tbl_studienplan sp USING(studienplan_id)
|
||||
JOIN lehre.tbl_studienordnung so USING(studienordnung_id)
|
||||
WHERE pss.status_kurzbz IN ('.$STATUS_KURZBZ.')
|
||||
AND pss.bewerbung_abgeschicktamum IS NULL
|
||||
AND ps.person_id = p.person_id
|
||||
@@ -249,6 +254,22 @@
|
||||
ORDER BY ps.zgvmanation DESC NULLS LAST, ps.prestudent_id DESC
|
||||
LIMIT 1
|
||||
) AS "ZGVMNation",
|
||||
(
|
||||
SELECT upper(tbl_nation.nationengruppe_kurzbz)
|
||||
FROM public.tbl_prestudent ps
|
||||
JOIN bis.tbl_nation ON ps.zgvnation = tbl_nation.nation_code
|
||||
WHERE ps.person_id = p.person_id
|
||||
ORDER BY ps.zgvnation DESC NULLS LAST, ps.prestudent_id DESC
|
||||
LIMIT 1
|
||||
) AS "ZGVNationGruppe",
|
||||
(
|
||||
SELECT upper(tbl_nation.nationengruppe_kurzbz)
|
||||
FROM public.tbl_prestudent ps
|
||||
JOIN bis.tbl_nation ON ps.zgvmanation = tbl_nation.nation_code
|
||||
WHERE ps.person_id = p.person_id
|
||||
ORDER BY ps.zgvmanation DESC NULLS LAST, ps.prestudent_id DESC
|
||||
LIMIT 1
|
||||
) AS "ZGVMNationGruppe",
|
||||
(
|
||||
SELECT tbl_organisationseinheit.bezeichnung
|
||||
FROM public.tbl_benutzerfunktion
|
||||
@@ -271,8 +292,10 @@
|
||||
LEFT JOIN (
|
||||
SELECT tpl.person_id,
|
||||
tpl.zeitpunkt,
|
||||
tpl.uid AS lockuser
|
||||
sp.nachname AS lockuser
|
||||
FROM system.tbl_person_lock tpl
|
||||
JOIN public.tbl_benutzer sb USING (uid)
|
||||
JOIN public.tbl_person sp ON sb.person_id = sp.person_id
|
||||
WHERE tpl.app = '.$APP.'
|
||||
) pl USING(person_id)
|
||||
LEFT JOIN (
|
||||
@@ -354,6 +377,8 @@
|
||||
ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'aktiv').')',
|
||||
'ZGV Nation BA',
|
||||
'ZGV Nation MA',
|
||||
'ZGV Gruppe BA',
|
||||
'ZGV Gruppe MA',
|
||||
'InfoCenter Mitarbeiter'
|
||||
),
|
||||
'formatRow' => function($datasetRaw) {
|
||||
@@ -410,6 +435,10 @@
|
||||
{
|
||||
$datasetRaw->{'OnholdDate'} = '-';
|
||||
}
|
||||
else
|
||||
{
|
||||
$datasetRaw->{'OnholdDate'} = date_format(date_create($datasetRaw->{'OnholdDate'}), 'Y-m-d H:i');
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'StgAbgeschickt'} == null)
|
||||
{
|
||||
@@ -441,6 +470,16 @@
|
||||
$datasetRaw->{'ZGVMNation'} = '-';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'ZGVNationGruppe'} == null)
|
||||
{
|
||||
$datasetRaw->{'ZGVNationGruppe'} = '-';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'ZGVMNationGruppe'} == null)
|
||||
{
|
||||
$datasetRaw->{'ZGVMNationGruppe'} = '-';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'InfoCenterMitarbeiter'} === null)
|
||||
{
|
||||
$datasetRaw->{'InfoCenterMitarbeiter'} = 'Nein';
|
||||
|
||||
@@ -5,12 +5,13 @@
|
||||
$INTERESSENT_STATUS = '\'Interessent\'';
|
||||
$STUDIENGANG_TYP = '\''.$this->variablelib->getVar('infocenter_studiensgangtyp').'\'';
|
||||
$TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\'';
|
||||
$LOGDATA_NAME = '\'Login with code\', \'Login with user\'';
|
||||
$LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'Attempt to register with existing mailadress\', \'Access code sent\', \'Personal data saved\'';
|
||||
$REJECTED_STATUS = '\'Abgewiesener\'';
|
||||
$ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz');
|
||||
$STATUS_KURZBZ = '\'Wartender\', \'Bewerber\', \'Aufgenommener\', \'Student\'';
|
||||
$STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\'';
|
||||
$ORG_NAME = '\'InfoCenter\'';
|
||||
$IDENTITY = '\'identity\'';
|
||||
|
||||
$query = '
|
||||
SELECT
|
||||
@@ -41,8 +42,10 @@ $query = '
|
||||
LIMIT 1
|
||||
) AS "LastActionType",
|
||||
(
|
||||
SELECT l.insertvon
|
||||
SELECT CASE WHEN sp.nachname IS NULL THEN l.insertvon ELSE sp.nachname END
|
||||
FROM system.tbl_log l
|
||||
LEFT JOIN public.tbl_benutzer on l.insertvon = tbl_benutzer.uid
|
||||
LEFT JOIN public.tbl_person sp on tbl_benutzer.person_id = sp.person_id
|
||||
WHERE l.taetigkeit_kurzbz IN('.$TAETIGKEIT_KURZBZ.')
|
||||
AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.')
|
||||
AND l.person_id = p.person_id
|
||||
@@ -103,11 +106,12 @@ $query = '
|
||||
LIMIT 1
|
||||
) AS "AnzahlAbgeschickt",
|
||||
(
|
||||
SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(sg.typ || sg.kurzbz || \':\' || sp.orgform_kurzbz)), \', \')
|
||||
SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(so.studiengangkurzbzlang) || \':\' || sp.orgform_kurzbz), \', \')
|
||||
FROM public.tbl_prestudentstatus pss
|
||||
JOIN public.tbl_prestudent ps USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang sg USING(studiengang_kz)
|
||||
JOIN lehre.tbl_studienplan sp USING(studienplan_id)
|
||||
JOIN lehre.tbl_studienordnung so USING(studienordnung_id)
|
||||
WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.'
|
||||
AND pss.bewerbung_abgeschicktamum IS NOT NULL
|
||||
AND ps.person_id = p.person_id
|
||||
@@ -125,11 +129,12 @@ $query = '
|
||||
LIMIT 1
|
||||
) AS "StgAbgeschickt",
|
||||
(
|
||||
SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(sg.typ || sg.kurzbz) || \':\' || sp.orgform_kurzbz), \', \')
|
||||
SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(so.studiengangkurzbzlang) || \':\' || sp.orgform_kurzbz), \', \')
|
||||
FROM public.tbl_prestudentstatus pss
|
||||
JOIN public.tbl_prestudent ps USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang sg USING(studiengang_kz)
|
||||
JOIN lehre.tbl_studienplan sp USING(studienplan_id)
|
||||
JOIN lehre.tbl_studienordnung so USING(studienordnung_id)
|
||||
WHERE pss.status_kurzbz IN ('.$STATUS_KURZBZ.')
|
||||
|
||||
AND ps.person_id = p.person_id
|
||||
@@ -194,14 +199,15 @@ $query = '
|
||||
LIMIT 1
|
||||
) AS "ReihungstestApplied",
|
||||
(
|
||||
SELECT rtp.datum
|
||||
SELECT CONCAT(rtp.datum, rtp.uhrzeit)
|
||||
FROM public.tbl_prestudentstatus pss
|
||||
JOIN public.tbl_prestudent ps USING(prestudent_id)
|
||||
LEFT JOIN (
|
||||
SELECT rtp.person_id,
|
||||
rt.studiensemester_kurzbz,
|
||||
rtp.teilgenommen,
|
||||
rt.datum
|
||||
rt.datum,
|
||||
rt.uhrzeit
|
||||
FROM public.tbl_rt_person rtp
|
||||
JOIN tbl_reihungstest rt ON(rtp.rt_id = rt.reihungstest_id)
|
||||
WHERE rt.stufe = 1
|
||||
@@ -243,13 +249,23 @@ $query = '
|
||||
LIMIT 1
|
||||
)
|
||||
LIMIT 1
|
||||
) AS "InfoCenterMitarbeiter"
|
||||
) AS "InfoCenterMitarbeiter",
|
||||
(
|
||||
SELECT akte.akte_id
|
||||
FROM public.tbl_akte akte
|
||||
JOIN public.tbl_dokument USING (dokument_kurzbz)
|
||||
WHERE akte.person_id = p.person_id
|
||||
AND dokument_kurzbz = '. $IDENTITY .'
|
||||
LIMIT 1
|
||||
) AS "AktenId"
|
||||
FROM public.tbl_person p
|
||||
LEFT JOIN (
|
||||
SELECT tpl.person_id,
|
||||
tpl.zeitpunkt,
|
||||
tpl.uid AS lockuser
|
||||
sp.nachname AS lockuser
|
||||
FROM system.tbl_person_lock tpl
|
||||
JOIN public.tbl_benutzer sb USING (uid)
|
||||
JOIN public.tbl_person sp ON sb.person_id = sp.person_id
|
||||
WHERE tpl.app = '.$APP.'
|
||||
) pl USING(person_id)
|
||||
WHERE
|
||||
@@ -313,7 +329,8 @@ $query = '
|
||||
'Reihungstest date',
|
||||
'ZGV Nation BA',
|
||||
'ZGV Nation MA',
|
||||
'InfoCenter Mitarbeiter'
|
||||
'InfoCenter Mitarbeiter',
|
||||
'Identitätsnachweis'
|
||||
),
|
||||
'formatRow' => function($datasetRaw) {
|
||||
|
||||
@@ -393,13 +410,13 @@ $query = '
|
||||
$datasetRaw->{'ReihungstestApplied'} = 'Nein';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'ReihungstestDate'} == null)
|
||||
if ($datasetRaw->{'ReihungstestDate'} == '')
|
||||
{
|
||||
$datasetRaw->{'ReihungstestDate'} = '-';
|
||||
}
|
||||
else
|
||||
{
|
||||
$datasetRaw->{'ReihungstestDate'} = date_format(date_create($datasetRaw->{'ReihungstestDate'}),'Y-m-d');
|
||||
$datasetRaw->{'ReihungstestDate'} = date_format(date_create($datasetRaw->{'ReihungstestDate'}),'Y-m-d H:i');
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'ZGVNation'} == null)
|
||||
@@ -421,6 +438,19 @@ $query = '
|
||||
$datasetRaw->{'InfoCenterMitarbeiter'} = 'Ja';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'AktenId'} !== null)
|
||||
{
|
||||
$datasetRaw->{'AktenId'} = sprintf(
|
||||
'<a href="outputAkteContent/%s">Identitätsnachweis</a>',
|
||||
$datasetRaw->{'AktenId'}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$datasetRaw->{'AktenId'} = '-';
|
||||
}
|
||||
|
||||
|
||||
return $datasetRaw;
|
||||
},
|
||||
'markRow' => function($datasetRaw) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
$INTERESSENT_STATUS = '\'Interessent\'';
|
||||
$STUDIENGANG_TYP = '\''.$this->variablelib->getVar('infocenter_studiensgangtyp').'\'';
|
||||
$TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\'';
|
||||
$LOGDATA_NAME = '\'Login with code\', \'Login with user\'';
|
||||
$LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'Attempt to register with existing mailadress\', \'Access code sent\', \'Personal data saved\'';
|
||||
$ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz');
|
||||
$STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\'';
|
||||
$ORG_NAME = '\'InfoCenter\'';
|
||||
@@ -85,11 +85,12 @@ $query = '
|
||||
LIMIT 1
|
||||
) AS "AnzahlAbgeschickt",
|
||||
(
|
||||
SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(sg.typ || sg.kurzbz || \':\' || sp.orgform_kurzbz)), \', \')
|
||||
SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(so.studiengangkurzbzlang) || \':\' || sp.orgform_kurzbz), \', \')
|
||||
FROM public.tbl_prestudentstatus pss
|
||||
JOIN public.tbl_prestudent ps USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang sg USING(studiengang_kz)
|
||||
JOIN lehre.tbl_studienplan sp USING(studienplan_id)
|
||||
JOIN lehre.tbl_studienordnung so USING(studienordnung_id)
|
||||
WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.'
|
||||
AND pss.bewerbung_abgeschicktamum IS NOT NULL
|
||||
AND ps.person_id = p.person_id
|
||||
|
||||
@@ -4,11 +4,6 @@ $APP = '\'infocenter\'';
|
||||
$INTERESSENT_STATUS = '\'Interessent\'';
|
||||
$TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\'';
|
||||
$LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\'';
|
||||
|
||||
$uid = get_uid();
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($uid);
|
||||
$oeKurz = $rechte->getOEkurzbz('lehre/zgvpruefung');
|
||||
$oeKurz = '\''. implode('\',\'', $oeKurz) . '\'';
|
||||
|
||||
$query = '
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
$PERSON_ID = getAuthPersonId();
|
||||
// all oe kurzbz for which logged user has a funktion
|
||||
$ALL_FUNKTIONEN_OE_KURZBZ = "('" . implode("','", array_keys($all_funktionen_oe_kurzbz)) . "')";
|
||||
// all oes for which logged user has issues permissions, including permissions for "special" issue funktion
|
||||
$ALL_OE_KURZBZ_BERECHTIGT = "('" . implode("','", $all_oe_kurzbz_berechtigt) . "')";
|
||||
$RELEVANT_PRESTUDENT_STATUS = "('Aufgenommener', 'Student', 'Incoming', 'Diplomand', 'Abbrecher', 'Unterbrecher', 'Absolvent')";
|
||||
$LANGUAGE_INDEX = getUserLanguage() == 'German' ? '1' : '2';
|
||||
@@ -29,39 +31,74 @@ $query = "WITH zustaendigkeiten AS (
|
||||
$query .= " THEN TRUE
|
||||
ELSE FALSE
|
||||
END AS \"zustaendig\"
|
||||
FROM system.tbl_fehler_zustaendigkeiten zst
|
||||
FROM system.tbl_fehler_zustaendigkeiten zst
|
||||
)";
|
||||
|
||||
$query .= "SELECT issue_id, fehlercode AS \"Fehlercode\", iss.fehlercode_extern AS \"Fehlercode extern\", datum AS \"Datum\",
|
||||
inhalt AS \"Inhalt\", inhalt_extern AS \"Inhalt extern\", iss.person_id AS \"PersonId\", iss.oe_kurzbz AS \"OE\",
|
||||
ftyp.bezeichnung_mehrsprachig[".$LANGUAGE_INDEX."] AS \"Fehlertyp\", stat.bezeichnung_mehrsprachig[".$LANGUAGE_INDEX."] AS \"Fehlerstatus\",
|
||||
verarbeitetvon AS \"Verarbeitet von\",verarbeitetamum AS \"Verarbeitet am\", fr.app AS \"Applikation\",
|
||||
fr.fehlertyp_kurzbz AS \"Fehlertypcode\", iss.status_kurzbz AS \"Statuscode\",
|
||||
pers.vorname AS \"Vorname\", pers.nachname AS \"Nachname\",
|
||||
CASE
|
||||
WHEN
|
||||
EXISTS(SELECT 1
|
||||
FROM zustaendigkeiten
|
||||
WHERE fehlercode = iss.fehlercode
|
||||
AND zustaendig = TRUE) /* If Zuständigkeit is defined for the oe/person, zustaendig. */
|
||||
THEN 'Ja'
|
||||
WHEN
|
||||
EXISTS(SELECT 1
|
||||
FROM zustaendigkeiten
|
||||
WHERE fehlercode = iss.fehlercode
|
||||
AND zustaendig = FALSE) /* If Zuständigkeit is defined for different oe/person, not zustaendig. */
|
||||
THEN 'Nein'
|
||||
ELSE 'Ja' /* If no Zuständigkeit defined, zustaendig by default. */
|
||||
END AS \"Hauptzuständig\"
|
||||
FROM system.tbl_issue iss
|
||||
JOIN system.tbl_fehler fr USING (fehlercode)
|
||||
JOIN system.tbl_fehlertyp ftyp USING (fehlertyp_kurzbz)
|
||||
JOIN system.tbl_issue_status stat USING (status_kurzbz)
|
||||
LEFT JOIN public.tbl_person pers ON iss.person_id = pers.person_id
|
||||
WHERE EXISTS ( /* if oe or person is specified in fehler_zustaendigkeiten */
|
||||
SELECT 1 FROM zustaendigkeiten
|
||||
WHERE fehlercode = iss.fehlercode
|
||||
AND zustaendig = TRUE)";
|
||||
inhalt AS \"Inhalt\", inhalt_extern AS \"Inhalt extern\", iss.person_id AS \"PersonId\", iss.oe_kurzbz AS \"OE\",
|
||||
ftyp.bezeichnung_mehrsprachig[".$LANGUAGE_INDEX."] AS \"Fehlertyp\", stat.bezeichnung_mehrsprachig[".$LANGUAGE_INDEX."] AS \"Fehlerstatus\",
|
||||
verarbeitetvon AS \"Verarbeitet von\",verarbeitetamum AS \"Verarbeitet am\", fr.app AS \"Applikation\",
|
||||
fr.fehlertyp_kurzbz AS \"Fehlertypcode\", iss.status_kurzbz AS \"Statuscode\",
|
||||
pers.vorname AS \"Vorname\", pers.nachname AS \"Nachname\",
|
||||
(
|
||||
/* show all relevant Studiengänge of person and wether it is an employee*/
|
||||
SELECT STRING_AGG(studiengang || ' ' || last_status, ' | ')
|
||||
|| (CASE WHEN EXISTS (
|
||||
SELECT 1 FROM public.tbl_mitarbeiter ma
|
||||
JOIN public.tbl_benutzer ben ON ma.mitarbeiter_uid = ben.uid
|
||||
WHERE person_id = prestudents.person_id
|
||||
AND ben.aktiv
|
||||
) THEN ' | Mitarbeiter' ELSE '' END)
|
||||
FROM (
|
||||
SELECT DISTINCT person_id, prestudent_id, UPPER(stg.typ || stg.kurzbz) AS studiengang, get_rolle_prestudent(ps.prestudent_id, null) AS last_status
|
||||
FROM public.tbl_prestudent ps
|
||||
JOIN public.tbl_studiengang stg USING (studiengang_kz)
|
||||
WHERE person_id = pers.person_id
|
||||
ORDER BY prestudent_id DESC
|
||||
) prestudents
|
||||
WHERE last_status IN ('Aufgenommener', 'Student', 'Incoming', 'Diplomand', 'Abbrecher', 'Unterbrecher', 'Absolvent')
|
||||
GROUP BY person_id
|
||||
LIMIT 1;
|
||||
) AS \"Zugehörigkeit\",
|
||||
CASE
|
||||
WHEN
|
||||
EXISTS(SELECT 1
|
||||
FROM zustaendigkeiten
|
||||
WHERE fehlercode = iss.fehlercode
|
||||
AND zustaendig = TRUE) /* If Zuständigkeit is defined for the oe/person, zustaendig. */
|
||||
THEN 'Ja'
|
||||
WHEN
|
||||
EXISTS(SELECT 1
|
||||
FROM zustaendigkeiten
|
||||
WHERE fehlercode = iss.fehlercode
|
||||
AND zustaendig = FALSE) /* If Zuständigkeit is defined for different oe/person, not zustaendig. */
|
||||
THEN 'Nein'
|
||||
ELSE 'Ja' /* If no Zuständigkeit defined, zustaendig by default. */
|
||||
END AS \"Hauptzuständig\",
|
||||
(
|
||||
SELECT string_agg(vorname || ' ' || nachname, ' | ' ORDER BY vorname, nachname)
|
||||
FROM system.tbl_fehler_zustaendigkeiten
|
||||
JOIN public.tbl_person USING (person_id)
|
||||
WHERE fehlercode = fr.fehlercode
|
||||
GROUP BY fehlercode
|
||||
) AS \"Person Zuständigkeiten\",
|
||||
(
|
||||
SELECT string_agg(organisationseinheittyp_kurzbz || ' ' || oe.bezeichnung || COALESCE(' - ' || fu.beschreibung, ''), ' | ' ORDER BY bezeichnung, oe_kurzbz)
|
||||
FROM system.tbl_fehler_zustaendigkeiten
|
||||
LEFT JOIN public.tbl_organisationseinheit oe USING (oe_kurzbz)
|
||||
LEFT JOIN public.tbl_funktion fu USING (funktion_kurzbz)
|
||||
WHERE fehlercode = fr.fehlercode
|
||||
GROUP BY fehlercode
|
||||
) AS \"Organisationseinheit Zuständigkeiten\"
|
||||
FROM system.tbl_issue iss
|
||||
JOIN system.tbl_fehler fr USING (fehlercode)
|
||||
JOIN system.tbl_fehlertyp ftyp USING (fehlertyp_kurzbz)
|
||||
JOIN system.tbl_issue_status stat USING (status_kurzbz)
|
||||
LEFT JOIN public.tbl_person pers ON iss.person_id = pers.person_id
|
||||
WHERE EXISTS ( /* if oe or person is specified in fehler_zustaendigkeiten */
|
||||
SELECT 1 FROM zustaendigkeiten
|
||||
WHERE fehlercode = iss.fehlercode
|
||||
AND zustaendig = TRUE)";
|
||||
|
||||
// show issue if it is assigend to oe of logged in user or to student of oe of logged in user
|
||||
if (!isEmptyArray($all_oe_kurzbz_berechtigt))
|
||||
@@ -78,13 +115,13 @@ if (!isEmptyArray($all_oe_kurzbz_berechtigt))
|
||||
AND NOT EXISTS (SELECT 1 /* irrelevant if already finished studies and studied a while ago */
|
||||
FROM public.tbl_prestudentstatus ps_finished
|
||||
JOIN public.tbl_studiensemester sem_finished USING (studiensemester_kurzbz)
|
||||
WHERE prestudent_id = ps.prestudent_id
|
||||
WHERE prestudent_id = ps.prestudent_id
|
||||
AND status_kurzbz IN ('Absolvent','Abbrecher','Abgewiesener')
|
||||
AND datum::date + interval '2 months' < NOW()
|
||||
AND EXISTS (SELECT 1 FROM public.tbl_prestudent /* if more recent prestudent exists, still display the issue */
|
||||
JOIN public.tbl_prestudentstatus USING (prestudent_id)
|
||||
JOIN public.tbl_studiensemester USING (studiensemester_kurzbz)
|
||||
WHERE tbl_prestudentstatus.status_kurzbz IN $RELEVANT_PRESTUDENT_STATUS
|
||||
WHERE tbl_prestudentstatus.status_kurzbz IN $RELEVANT_PRESTUDENT_STATUS
|
||||
AND person_id = ps.person_id
|
||||
AND prestudent_id <> ps_finished.prestudent_id
|
||||
AND tbl_studiensemester.start::date > sem_finished.start::date)
|
||||
@@ -111,7 +148,7 @@ $filterWidgetArray = array(
|
||||
'datasetName' => 'issues',
|
||||
'filter_id' => $this->input->get('filter_id'),
|
||||
'tableUniqueId' => 'issues',
|
||||
'requiredPermissions' => 'admin',
|
||||
'requiredPermissions' => 'system/issues_verwalten',
|
||||
'datasetRepresentation' => 'tablesorter',
|
||||
'checkboxes' => 'issue_id',
|
||||
'columnsAliases' => array(
|
||||
@@ -132,7 +169,10 @@ $filterWidgetArray = array(
|
||||
ucfirst($this->p->t('fehlermonitoring', 'statuscode')),
|
||||
ucfirst($this->p->t('person', 'vorname')),
|
||||
ucfirst($this->p->t('person', 'nachname')),
|
||||
ucfirst($this->p->t('fehlermonitoring', 'hauptzustaendig'))
|
||||
ucfirst($this->p->t('fehlermonitoring', 'zugehoerigkeit')),
|
||||
ucfirst($this->p->t('fehlermonitoring', 'hauptzustaendig')),
|
||||
ucfirst($this->p->t('fehlermonitoring', 'zustaendigePersonen')),
|
||||
ucfirst($this->p->t('fehlermonitoring', 'zustaendigeOrganisationseinheiten'))
|
||||
),
|
||||
'formatRow' => function($datasetRaw) {
|
||||
|
||||
@@ -161,16 +201,26 @@ $filterWidgetArray = array(
|
||||
$datasetRaw->{'OE'} = '-';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'Verarbeitet am'} == null)
|
||||
{
|
||||
$datasetRaw->{'Verarbeitet am'} = '-';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'Verarbeitet von'} == null)
|
||||
{
|
||||
$datasetRaw->{'Verarbeitet von'} = '-';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'Zugehörigkeit'} == null)
|
||||
{
|
||||
$datasetRaw->{'Zugehörigkeit'} = '-';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'Person Zuständigkeiten'} == null)
|
||||
{
|
||||
$datasetRaw->{'Person Zuständigkeiten'} = '-';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'Organisationseinheit Zuständigkeiten'} == null)
|
||||
{
|
||||
$datasetRaw->{'Organisationseinheit Zuständigkeiten'} = '-';
|
||||
}
|
||||
|
||||
return $datasetRaw;
|
||||
},
|
||||
'markRow' => function($datasetRaw) {
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
<?php
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'Fehler Zuständigkeiten',
|
||||
'jquery' => true,
|
||||
'jqueryui' => true,
|
||||
'jquerycheckboxes' => true,
|
||||
'bootstrap' => true,
|
||||
'fontawesome' => true,
|
||||
'sbadmintemplate' => true,
|
||||
'tablesorter' => true,
|
||||
'ajaxlib' => true,
|
||||
'filterwidget' => true,
|
||||
'navigationwidget' => true,
|
||||
'dialoglib' => true,
|
||||
'phrases' => array(
|
||||
'ui',
|
||||
'fehlermonitoring'
|
||||
),
|
||||
'customCSSs' => array('public/css/issues/issuesZustaendigkeiten.css', 'public/css/sbadmin2/tablesort_bootstrap.css'),
|
||||
'customJSs' => array('public/js/issues/issuesZustaendigkeiten.js', 'public/js/bootstrapper.js')
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
|
||||
<?php echo $this->widgetlib->widget('NavigationWidget'); ?>
|
||||
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header">
|
||||
<?php echo $this->p->t('fehlermonitoring', 'fehlerZustaendigkeiten') ?>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-4">
|
||||
<div class="panel panel-default">
|
||||
<table class="table table-bordered" id="fehlercodeSelectTable">
|
||||
<tr>
|
||||
<td class="tableCellNoRightBorder">
|
||||
<label for="fehlerappSelect">App</label>
|
||||
<select class="form-control" name="fehlerappSelect" id="fehlerappSelect">
|
||||
</select>
|
||||
</td>
|
||||
<td class="tableCellNoLeftBorder tableCellNoRightBorder">
|
||||
<label for="fehlercodeSelect"><?php echo $this->p->t('fehlermonitoring', 'fehlercode') ?></label>
|
||||
<select class="form-control" name="fehlercodeSelect" id="fehlercodeSelect">
|
||||
</select>
|
||||
</td>
|
||||
<td class="tableCellNoLeftBorder" id="fehlercodeInfoCell"><i class="fa fa-info-circle"></i></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<div class="panel panel-default">
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td>
|
||||
<label for="mitarbeiterSelect"><?php echo $this->p->t('fehlermonitoring', 'zustaendigerMitarbeiter') ?></label>
|
||||
<input type="text" class="form-control" name="mitarbeiterSelect" id="mitarbeiterSelect">
|
||||
<input type="hidden" name="mitarbeiter_person_id" id="mitarbeiter_person_id">
|
||||
</td>
|
||||
<td align="center">
|
||||
<?php echo $this->p->t('fehlermonitoring', 'oder') ?>
|
||||
<br>
|
||||
<i class="fa fa-arrows-h"></i>
|
||||
</td>
|
||||
<td class="tableCellNoRightBorder">
|
||||
<label for="oeSelect"><?php echo $this->p->t('fehlermonitoring', 'organisationseinheit') ?></label>
|
||||
<select class="form-control" name="oeSelect" id="oeSelect">
|
||||
</select>
|
||||
</td>
|
||||
<td class="tableCellNoLeftBorder">
|
||||
<label for="funktionSelect"><?php echo $this->p->t('fehlermonitoring', 'funktion') ?></label>
|
||||
<select class="form-control" name="funktionSelect" id="funktionSelect">
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-offset-3 col-lg-9">
|
||||
<button class="btn btn-default" id="assignZustaendigkeit">
|
||||
<i class="fa fa-angle-double-right"></i>
|
||||
<?php echo $this->p->t('fehlermonitoring', 'zustaendigkeitZuweisen') ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<?php $this->load->view('system/issues/issuesZustaendigkeitenData.php'); ?>
|
||||
</div>
|
||||
<div class="modal fade" id="fehlerInfo" tabindex="-1"
|
||||
role="dialog"
|
||||
aria-labelledby="fehlerInfoLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close"
|
||||
data-dismiss="modal"
|
||||
aria-hidden="true">×
|
||||
</button>
|
||||
<h4 class="modal-title" id="fehlerInfoLabel">
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body" id="fehlerInfoContent">
|
||||
<table class="table table-condensed table-bordered">
|
||||
<tr>
|
||||
<td>
|
||||
<b><?php echo ucfirst($this->p->t('fehlermonitoring', 'fehlercode')) ?></b>
|
||||
</td>
|
||||
<td>
|
||||
<span id="fehlercodeInfo"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<b><?php echo ucfirst($this->p->t('fehlermonitoring', 'fehlerkurzbz')) ?></b>
|
||||
</td>
|
||||
<td>
|
||||
<span id="fehlerkurzbzInfo"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<b><?php echo ucfirst($this->p->t('fehlermonitoring', 'fehlertyp')) ?></b>
|
||||
</td>
|
||||
<td>
|
||||
<span id="fehlertypInfo"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<b><?php echo ucfirst($this->p->t('fehlermonitoring', 'fehlercodeExtern')) ?></b>
|
||||
</td>
|
||||
<td>
|
||||
<span id="fehlercodeExternInfo"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<b><?php echo ucfirst($this->p->t('fehlermonitoring', 'fehlertext')) ?></b>
|
||||
</td>
|
||||
<td>
|
||||
<span id="fehlertextInfo"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal-fade -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
// get assigned Zustaendigkeiten
|
||||
$query = "SELECT fehlerzustaendigkeiten_id, fe.fehlercode, fe.fehlercode_extern, fehler_kurzbz, fehlertext, fehlertyp_kurzbz, fe.app,
|
||||
pers.person_id, pers.vorname, pers.nachname,
|
||||
oe.oe_kurzbz, oe.bezeichnung AS oe_bezeichnung, funk.funktion_kurzbz, funk.beschreibung AS funktion_beschreibung
|
||||
FROM system.tbl_fehler_zustaendigkeiten zst
|
||||
JOIN system.tbl_fehler fe USING (fehlercode)
|
||||
LEFT JOIN public.tbl_person pers USING (person_id)
|
||||
LEFT JOIN public.tbl_organisationseinheit oe USING (oe_kurzbz)
|
||||
LEFT JOIN public.tbl_funktion funk USING (funktion_kurzbz)
|
||||
ORDER BY fe.fehlercode, pers.nachname, oe.bezeichnung, funk.beschreibung";
|
||||
|
||||
$filterWidgetArray = array(
|
||||
'query' => $query,
|
||||
'app' => 'core',
|
||||
'datasetName' => 'fehlerZustaendigkeiten',
|
||||
'filter_id' => $this->input->get('filter_id'),
|
||||
'tableUniqueId' => 'issuesZustaendigkeiten',
|
||||
'requiredPermissions' => 'admin',
|
||||
'datasetRepresentation' => 'tablesorter',
|
||||
'additionalColumns' => array('Delete'),
|
||||
'columnsAliases' => array(
|
||||
'ID',
|
||||
ucfirst($this->p->t('fehlermonitoring', 'fehlercode')),
|
||||
ucfirst($this->p->t('fehlermonitoring', 'fehlercodeExtern')),
|
||||
ucfirst($this->p->t('fehlermonitoring', 'fehlerkurzbz')),
|
||||
ucfirst($this->p->t('fehlermonitoring', 'fehlertext')),
|
||||
ucfirst($this->p->t('fehlermonitoring', 'fehlertyp')),
|
||||
'app',
|
||||
'PersonId',
|
||||
ucfirst($this->p->t('person', 'vorname')),
|
||||
ucfirst($this->p->t('person', 'nachname')),
|
||||
ucfirst($this->p->t('fehlermonitoring', 'oeKurzbz')),
|
||||
ucfirst($this->p->t('fehlermonitoring', 'oeBezeichnung')),
|
||||
ucfirst($this->p->t('fehlermonitoring', 'funktionKurzbz')),
|
||||
ucfirst($this->p->t('fehlermonitoring', 'funktionBeschreibung'))
|
||||
),
|
||||
'formatRow' => function($datasetRaw) {
|
||||
|
||||
$datasetRaw->{'Delete'} =
|
||||
"<button id='".$datasetRaw->{'fehlerzustaendigkeiten_id'}."' class='btn btn-default deleteBtn'>"
|
||||
.ucfirst($this->p->t('ui', 'loeschen'))."</button>";
|
||||
|
||||
if ($datasetRaw->{'person_id'} == null)
|
||||
{
|
||||
$datasetRaw->{'person_id'} = '-';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'vorname'} == null)
|
||||
{
|
||||
$datasetRaw->{'vorname'} = '-';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'nachname'} == null)
|
||||
{
|
||||
$datasetRaw->{'nachname'} = '-';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'oe_kurzbz'} == null)
|
||||
{
|
||||
$datasetRaw->{'oe_kurzbz'} = '-';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'oe_bezeichnung'} == null)
|
||||
{
|
||||
$datasetRaw->{'oe_bezeichnung'} = '-';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'funktion_kurzbz'} == null)
|
||||
{
|
||||
$datasetRaw->{'funktion_kurzbz'} = '-';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'funktion_beschreibung'} == null)
|
||||
{
|
||||
$datasetRaw->{'funktion_beschreibung'} = '-';
|
||||
}
|
||||
|
||||
return $datasetRaw;
|
||||
}
|
||||
);
|
||||
|
||||
echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray);
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
// By default set the parameters to null
|
||||
$title = isset($title) ? $title : null;
|
||||
$refresh = isset($refresh) ? $refresh : null;
|
||||
$customCSSs = isset($customCSSs) ? $customCSSs : null;
|
||||
$customJSs = isset($customJSs) ? $customJSs : null;
|
||||
$phrases = isset($phrases) ? $phrases : null;
|
||||
@@ -48,6 +49,8 @@
|
||||
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<?php printRefreshMeta($refresh); ?>
|
||||
|
||||
<?php
|
||||
// --------------------------------------------------------------------------------------------------------
|
||||
// CSS
|
||||
|
||||
+23
-173
@@ -22,21 +22,21 @@
|
||||
*/
|
||||
session_start();
|
||||
|
||||
require_once('../../config/cis.config.inc.php');
|
||||
require_once('../../include/wochenplan.class.php');
|
||||
require_once('../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../include/betriebsmittel.class.php');
|
||||
require_once('../../include/betriebsmittelperson.class.php');
|
||||
require_once('../../include/betriebsmitteltyp.class.php');
|
||||
require_once('../../include/mail.class.php');
|
||||
require_once('../../include/news.class.php');
|
||||
require_once('../../include/content.class.php');
|
||||
require_once('../../include/studiensemester.class.php');
|
||||
require_once('../../include/konto.class.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/authentication.class.php');
|
||||
require_once('../../include/addon.class.php');
|
||||
require_once('../../include/'.EXT_FKT_PATH.'/serviceterminal.inc.php');
|
||||
require_once('../../config/cis.config.inc.php');
|
||||
require_once('../../include/wochenplan.class.php');
|
||||
require_once('../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../include/betriebsmittel.class.php');
|
||||
require_once('../../include/betriebsmittelperson.class.php');
|
||||
require_once('../../include/betriebsmitteltyp.class.php');
|
||||
require_once('../../include/mail.class.php');
|
||||
require_once('../../include/news.class.php');
|
||||
require_once('../../include/content.class.php');
|
||||
require_once('../../include/studiensemester.class.php');
|
||||
require_once('../../include/konto.class.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/authentication.class.php');
|
||||
require_once('../../include/addon.class.php');
|
||||
require_once('../../include/'.EXT_FKT_PATH.'/serviceterminal.inc.php');
|
||||
|
||||
if (!$db = new basis_db())
|
||||
$db=false;
|
||||
@@ -679,10 +679,6 @@ function meine_uid_informationen($db,$uid,$user="")
|
||||
if ($db)
|
||||
$user_array=personen_id_read_mitarbeiter_oder_student($db,$user->person_id);
|
||||
|
||||
#echo '<hr>';
|
||||
##var_dump($user_array);
|
||||
#var_dump($_SESSION[constSESSIONNAME]["ldap_get_entries"]);
|
||||
|
||||
if (isset($user_array) && is_array($user_array) && count($user_array)>1)
|
||||
{
|
||||
$html_user_daten.='<table class="persoenlichedaten">';
|
||||
@@ -724,54 +720,6 @@ function meine_uid_informationen($db,$uid,$user="")
|
||||
|
||||
$html_user_daten.='<hr>';
|
||||
|
||||
// eMail senden nach anforderung
|
||||
/*
|
||||
$send_mail=(isset($_REQUEST['send_mail']) ? $_REQUEST['send_mail']:false);
|
||||
if ($send_mail)
|
||||
{
|
||||
$to=$uid.'@'.DOMAIN;
|
||||
$from=MAIL_CIS;
|
||||
$subject=CAMPUS_NAME.' Informationen';
|
||||
|
||||
$mail=new mail($to, $from, $subject, $html_user_daten_detail);
|
||||
if (isset($user_array) && is_array($user_array) && count($user_array)>1)
|
||||
{
|
||||
reset($user_array);
|
||||
for ($i=0;$i<count($user_array);$i++)
|
||||
{
|
||||
if ($uid!=$user_array[$i]->uid && ($user_array[$i]->aktiv='t' || ($user_array[$i]->aktiv !='f' && $user_array[$i]->aktiv)) )
|
||||
$mail->setCCRecievers($user_array[$i]->uid.'@'.DOMAIN);
|
||||
}
|
||||
}
|
||||
$mail->setHTMLContent($html_user_daten_detail);
|
||||
if ($mail->send())
|
||||
$html_user_daten.='<p>email gesendet an '.$mail->to.' '.($mail->CC_recievers?$mail->CC_recievers:'').'</p>';
|
||||
else
|
||||
$html_user_daten.='<p>email nicht gesendet an '.$mail->to.'</p>';
|
||||
}
|
||||
// Send eMail Auswahl anzeigen
|
||||
else
|
||||
{
|
||||
$farbe='gruen';
|
||||
$html_user_daten.='<table class="persoenlichedaten">';
|
||||
$html_user_daten.='<tr>';
|
||||
$html_user_daten.='<td>';
|
||||
$html_user_daten.='<a href="'.$_SERVER['PHP_SELF'].'?work=meinedaten&send_mail=x&standort_id='.$standort_id.'">';
|
||||
$html_user_daten.='<b class="'.$farbe.'_rtop">
|
||||
<b class="'.$farbe.'_r1"></b> <b class="'.$farbe.'_r2"></b> <b class="'.$farbe.'_r3"></b> <b class="'.$farbe.'_r4"></b>
|
||||
</b>
|
||||
<span class="'.$farbe.'_mitteText">';
|
||||
$html_user_daten.='Informationen per Mail senden';
|
||||
$html_user_daten.='
|
||||
</span>
|
||||
<b class="'.$farbe.'_rbottom">
|
||||
<b class="'.$farbe.'_r4"></b><b class="'.$farbe.'_r3"></b> <b class="'.$farbe.'_r2"></b> <b class="'.$farbe.'_r1"></b>
|
||||
</b>';
|
||||
$html_user_daten.='</a>';
|
||||
$html_user_daten.='</td>';
|
||||
$html_user_daten.='</tr>';
|
||||
$html_user_daten.='</table>';
|
||||
}*/
|
||||
return $html_user_daten;
|
||||
}
|
||||
#-------------------------------------------------------------------------------------------
|
||||
@@ -952,33 +900,6 @@ function meine_uid_informationen_detail($db,$uid,$count=0)
|
||||
die($db->db_last_error());
|
||||
$nr_mg=$db->db_num_rows($erg_mg);
|
||||
|
||||
// Betriebsmittel zur Person lesen
|
||||
/*
|
||||
$betriebsmittelperson=array();
|
||||
$qry="SELECT nummer,betriebsmitteltyp FROM public.vw_betriebsmittelperson where uid='".addslashes(trim($uid))."' and aktiv and benutzer_aktiv and ( retouram IS NULL ) LIMIT 50 ; ";
|
||||
if(!$result=$db->db_query($qry))
|
||||
die('Probleme beim Lesen der Benutzer uid '.$db->db_last_error());
|
||||
if ($result)
|
||||
{
|
||||
while($rows = $db->db_fetch_object($result))
|
||||
{
|
||||
$rows->asco='ASCO Datensätze gefunden';
|
||||
if (is_numeric($rows->nummer) && $mssql_verbindung)
|
||||
{
|
||||
$card_no=$rows->nummer;
|
||||
$anfrage = mssql_query('SELECT * FROM view_fh_technikum_mitarbeiterkarten_berechtigungen where card_no='.$card_no);
|
||||
if (mssql_num_rows($anfrage))
|
||||
{
|
||||
$rows->asco=array();
|
||||
while ($datensatz = mssql_fetch_object($anfrage))
|
||||
$rows->asco[]=$datensatz;
|
||||
}
|
||||
mssql_free_result($anfrage);
|
||||
}
|
||||
$betriebsmittelperson[]=$rows;
|
||||
}
|
||||
}*/
|
||||
|
||||
if ($count==0)
|
||||
{
|
||||
$html_user_daten.='<h1>Persönliche Daten</h1>';
|
||||
@@ -1022,49 +943,6 @@ function meine_uid_informationen_detail($db,$uid,$count=0)
|
||||
$html_user_daten.='<tr><td style="background-color: #E9ECEE;" align="center" colspan="2" ><b><font size="+1">Email</font></b></td></tr>';
|
||||
$html_user_daten.='<tr><td ><b>Intern</b></td><td >'.$email.'</td></tr>';
|
||||
$html_user_daten.='<tr><td ><b>Alias</b></td><td >'.$email_alias.'</td></tr>';
|
||||
/*
|
||||
|
||||
$html_user_daten.='<tr><td style="background-color: #E9ECEE;" align="center" colspan="2" ><b>Mitglied in folgenden Verteilern</b></td></tr>';
|
||||
for($i=0;$i<$nr_mg;$i++)
|
||||
{
|
||||
$row=$db->db_fetch_object($erg_mg,$i);
|
||||
|
||||
$html_user_daten.='<tr>';
|
||||
$html_user_daten.='<td valign="top"><a class="Item" href="mailto:'.trim(strtolower($row->gruppe_kurzbz)).'@'.DOMAIN.'">'.strtolower($row->gruppe_kurzbz).' </td>';
|
||||
$html_user_daten.='<td >'.$row->beschreibung.' </td>';
|
||||
$html_user_daten.='</tr>';
|
||||
}
|
||||
|
||||
if (isset($matrikelnr))
|
||||
{
|
||||
$html_user_daten.='<TR><TD valign="top"><A class="Item" href="mailto:'.strtolower(trim($stgkz)).'_std@'.DOMAIN.'">'.strtolower($stgkz).'_std </TD>';
|
||||
$html_user_daten.="\n<TD > Alle Studierdenden von $stgbez</TD><TD></TD></TR>";
|
||||
$html_user_daten.='<TR><TD valign="top">'.strtolower($stgkz).$semester.' </TD>';
|
||||
$html_user_daten.="\n<TD > Alle Studierenden von $stgkz $semester</TD><TD></TD></TR>";
|
||||
$html_user_daten.='<TR><TD valign="top"><A class="Item" href="mailto:'.strtolower(trim($stgkz)).trim($semester).strtolower(trim($verband)).'@'.DOMAIN.'">'.strtolower($stgkz).$semester.strtolower($verband).' </TD>';
|
||||
$html_user_daten.="\n<TD > Alle Studierenden von $stgkz $semester$verband</TD><TD></TD></TR>";
|
||||
$html_user_daten.='<TR><TD valign="top"><A class="Item" href="mailto:'.strtolower(trim($stgkz)).trim($semester).strtolower(trim($verband)).trim($gruppe).'@'.DOMAIN.'">'.strtolower($stgkz).$semester.strtolower($verband).$gruppe.' </TD>';
|
||||
$html_user_daten.="\n<TD > Alle Studierenden von $stgkz $semester$verband$gruppe</TD><TD></TD></TR>";
|
||||
}
|
||||
$html_user_daten.='</table> </td>';
|
||||
|
||||
$html_user_daten.='<td valign="top" width="50%"><table width="100%">';
|
||||
if ($stud_num_rows==1)
|
||||
{
|
||||
$html_user_daten.='<tr><td colspan="2" align="center" style="background-color: #E9ECEE;"><b><font size="+1">StudentIn</font></b></td></tr>';
|
||||
$html_user_daten.="<td colspan='2' >
|
||||
Studiengang: $stgbez<br>
|
||||
Semester: $semester<br>
|
||||
Verband: $verband<br>
|
||||
Gruppe: $gruppe<br>
|
||||
Matrikelnummer: $matrikelnr";
|
||||
$html_user_daten.='</td></tr>';
|
||||
}
|
||||
else if ($lekt_num_rows==1)
|
||||
{
|
||||
$html_user_daten.='<tr><td colspan="2" align="center" style="background-color: #E9ECEE;"><b><font size="+1">Lektor </font></b></td></tr>';
|
||||
$html_user_daten.='<td colspan="2"><b>Kurzzeichen: </b>'.$kurzbz.'<br><b>Standort: </b>'.$ort.'<br><b>'.($tel!=''?'Telefon TW:</b> '.$vorwahl.' '.$tel:'').'</td></tr>';
|
||||
}*/
|
||||
|
||||
$html_user_daten.='</table>';
|
||||
$html_user_daten.=' </td></tr></table>';
|
||||
@@ -1096,30 +974,6 @@ function alle_uid_stundenplan_informationen($db,$uid,$user_array="")
|
||||
return $html_liste_raum;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// Kalenderwoche und Tage Initialisieren
|
||||
// ------------------------------------------------------------------------------------------
|
||||
/*
|
||||
$date = date('d');
|
||||
$month = date('m');
|
||||
$year = date('y');
|
||||
$weekday = date('w');
|
||||
$kalenderweek = ((int)date('W')<10?'0'.(int)date('W'):date('W'));
|
||||
|
||||
// Montag ermitteln
|
||||
if($weekday == 0)
|
||||
{
|
||||
$datum=mktime(0, 0, 0, $month, $date-$weekday -6, $year);
|
||||
$ersterTagMonat=date('m', mktime(0, 0, 0, $month, $date-$weekday -6, $year));
|
||||
$ersterTag=date('d', mktime(0, 0, 0, $month, $date-$weekday -6, $year));
|
||||
}
|
||||
else
|
||||
{
|
||||
$datum=mktime(0, 0, 0, $month, $date-$weekday +1, $year);
|
||||
$ersterTagMonat=date('m', mktime(0, 0, 0, $month, $date-$weekday +1, $year));
|
||||
$ersterTag=date('d', mktime(0, 0, 0, $month, $date-$weekday +1, $year));
|
||||
}
|
||||
*/
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// Alle Termine zum User lesen
|
||||
// ------------------------------------------------------------------------------------------
|
||||
@@ -1334,18 +1188,19 @@ function alle_raum_informationen($db,$raumtyp_kurzbz,$ort_kurzbz, $standort_id)
|
||||
$qry.=" SELECT DISTINCT ";
|
||||
$qry.=" tbl_ortraumtyp.ort_kurzbz ";
|
||||
$qry.=" ,tbl_ort.bezeichnung ,tbl_ort.aktiv ";
|
||||
$qry.=" , (SELECT 'gesperrt'::text FROM public.tbl_ortraumtyp WHERE raumtyp_kurzbz='Gesperrt' AND ort_kurzbz=tbl_ort.ort_kurzbz) as gesperrt";
|
||||
$qry.=" FROM tbl_raumtyp , tbl_ortraumtyp , tbl_ort ";
|
||||
$qry.=" WHERE tbl_ortraumtyp.raumtyp_kurzbz=tbl_raumtyp.raumtyp_kurzbz ";
|
||||
$qry.=" AND tbl_ort.ort_kurzbz=tbl_ortraumtyp.ort_kurzbz ";
|
||||
$qry.=" AND tbl_ort.aktiv ";
|
||||
$qry.=" AND lower(tbl_raumtyp.raumtyp_kurzbz) like lower('%".$db->db_escape(trim($raumtyp_kurzbz))."%') ";
|
||||
if($standort_id!='')
|
||||
$qry.=" AND (tbl_ort.standort_id=".$db->db_add_param($standort_id, FHC_INTEGER).' OR tbl_ort.standort_id is null)';
|
||||
$qry.=" AND (tbl_ort.standort_id=".$db->db_add_param($standort_id, FHC_INTEGER)." OR tbl_ort.standort_id is null)";
|
||||
$qry.=" order by tbl_ortraumtyp.ort_kurzbz ";
|
||||
$qry.=" ; ";
|
||||
|
||||
if(!$result=$db->db_query($qry))
|
||||
die('Probleme beim lesen der Raumtyptabelle '.$db->db_last_error());
|
||||
die('Probleme beim lesen der Raumtyptabelle ');
|
||||
$num_rows_stunde=$db->db_num_rows($result);
|
||||
|
||||
if($num_rows_stunde==0)
|
||||
@@ -1372,7 +1227,6 @@ function alle_raum_informationen($db,$raumtyp_kurzbz,$ort_kurzbz, $standort_id)
|
||||
// Raumreservierungen fuer Aktive Raumauswahl
|
||||
// --------------------------------------------------------------
|
||||
|
||||
|
||||
// Die aktive Stunde ermitteln - zum lesen welcher Raum jetzt besetzt ist - aktive Lehreinheit
|
||||
$row_stunde=array();
|
||||
|
||||
@@ -1382,9 +1236,6 @@ function alle_raum_informationen($db,$raumtyp_kurzbz,$ort_kurzbz, $standort_id)
|
||||
$qry.=" WHERE ".$db->db_add_param(constAktuelleZeitHHMi,FHC_STRING)." between to_char(tbl_stunde.beginn, 'HH24MI') and to_char(tbl_stunde.ende, 'HH24MI') ";
|
||||
$qry.=" ORDER BY stunde LIMIT 1 ; ";
|
||||
|
||||
# $qry.=" WHERE '". constAktuelleZeitHH."' between to_char(tbl_stunde.beginn, 'HH24') and to_char(tbl_stunde.ende, 'HH24') ";
|
||||
# $qry.=" ORDER BY stunde desc LIMIT 1; ";
|
||||
|
||||
if(!$result=$db->db_query($qry))
|
||||
die('Probleme beim lesen der Raumtyptabelle '.$db->db_last_error());
|
||||
|
||||
@@ -1436,8 +1287,8 @@ function alle_raum_informationen($db,$raumtyp_kurzbz,$ort_kurzbz, $standort_id)
|
||||
$farbe="gruen";
|
||||
}
|
||||
|
||||
# if ($farbe=="orange")
|
||||
# var_dump($info);
|
||||
if ($row_raum[$i]->gesperrt=="gesperrt")
|
||||
$farbe="rot";
|
||||
|
||||
// Nach 4 Raumanzeigen eine Neuezeile erzeugen
|
||||
$html_liste_raum.=($i==0 || $i%4?"":"</tr><tr>");
|
||||
@@ -1461,7 +1312,7 @@ function alle_raum_informationen($db,$raumtyp_kurzbz,$ort_kurzbz, $standort_id)
|
||||
|
||||
$html_liste_raum.='<td><table><tr><td><span class="gruen_mitteText"> </span></td><td>Mindestens nächsten 2 Einheiten frei</td></tr></table></td>';
|
||||
$html_liste_raum.='<td><table><tr><td><span class="orange_mitteText"> </span></td><td>Derzeit frei</td></tr></table></td>';
|
||||
$html_liste_raum.='<td><table><tr><td><span class="rot_mitteText"> </span></td><td>Raum derzeit besetzt</td></tr></table></td>';
|
||||
$html_liste_raum.='<td><table><tr><td><span class="rot_mitteText"> </span></td><td>Raum derzeit besetzt / gesperrt</td></tr></table></td>';
|
||||
$html_liste_raum.='</tr>';
|
||||
$html_liste_raum.='</table>';
|
||||
$html_liste_raum.='<hr>';
|
||||
@@ -1506,7 +1357,6 @@ function alle_raum_informationen($db,$raumtyp_kurzbz,$ort_kurzbz, $standort_id)
|
||||
// dh. Letztes Ende ist gleich Start aktueller Datensatz
|
||||
if ($lastEnde && $row->time_beginn!=$lastEnde)
|
||||
{
|
||||
# echo "<p>Zeit korr. Funktion:alle_raum_informationen ".$row->beginn_show." wird zu ".$lastShowEnde."</p>";
|
||||
$row->time_beginn=$lastEnde;
|
||||
}
|
||||
|
||||
@@ -1900,7 +1750,7 @@ function uid_read_mitarbeiter_oder_student($db,$uid)
|
||||
// Wenn kein Mitarbeiter pruefen ob Student
|
||||
$qry="SELECT uid,person_id,anrede,titelpre,vorname,vornamen,nachname,aktiv FROM campus.vw_student where uid=".$db->db_add_param(trim($uid), FHC_STRING)." LIMIT 1 ; ";
|
||||
if(!$result=$db->db_query($qry))
|
||||
die('Probleme beim Lesen der Studierenden '.$db->db_last_error());
|
||||
die('Probleme beim Lesen der Studierenden ');
|
||||
if ($num_rows_stunde=$db->db_num_rows($result))
|
||||
{
|
||||
while($rows = $db->db_fetch_object($result))
|
||||
@@ -1976,7 +1826,7 @@ function read_create_html_news($db,$fachbereich_kurzbz,$studiengang_kz,$semester
|
||||
{
|
||||
if(defined('CIS_INFOSCREEN_NEWS_ANZEIGEN') && CIS_INFOSCREEN_NEWS_ANZEIGEN==false)
|
||||
return '';
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// Lesen Newstickerzeilen
|
||||
// ------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -37,6 +37,11 @@ else
|
||||
$ip = $_SERVER["REMOTE_ADDR"];
|
||||
}
|
||||
|
||||
if(isset($_GET['norefresh']))
|
||||
$norefresh = true;
|
||||
else
|
||||
$norefresh = false;
|
||||
|
||||
$infoscreen = new infoscreen();
|
||||
$i=-1;
|
||||
$refreshzeit = 40; // Default Refreshzeit
|
||||
@@ -90,9 +95,12 @@ if(isset($infoscreen_content) && isset($infoscreen_content[$aktuellerContentIdx]
|
||||
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="refresh" content="',$refreshzeit,'">
|
||||
<link href="../../skin/infoscreen.css" rel="stylesheet" type="text/css">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
|
||||
if (!$norefresh)
|
||||
{
|
||||
echo '<meta http-equiv="refresh" content="',$refreshzeit,'">';
|
||||
}
|
||||
echo ' <link href="../../skin/infoscreen.css" rel="stylesheet" type="text/css">
|
||||
';
|
||||
|
||||
//Skript fuer den automatischen bildlauf
|
||||
@@ -161,21 +169,22 @@ echo '
|
||||
echo '<!-- Last content:'.$lastinfoscreencontent.' ID:'.$infoscreen_id.' IP:'.$ip.'-->';
|
||||
if($infoscreen_id!='' && isset($content[$aktuellerContentIdx]))
|
||||
{
|
||||
|
||||
echo '<center style="height: 100%"><iframe id="content" src="../../cms/content.php?content_id='.$content[$aktuellerContentIdx].'" ></iframe></center>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<br><br><br>
|
||||
<center>
|
||||
<h1>Informationsbildschirm - '.CAMPUS_NAME.'</h1>
|
||||
<br><br><br>
|
||||
Dieser Informationsbildschirm wurde noch nicht registriert
|
||||
<br><br>
|
||||
IP-Adresse:'.$ip.'
|
||||
</center>';
|
||||
echo ' <table style="width: 100%; height: 100%">
|
||||
<tr>
|
||||
<td style="height: 80%; vertical-align: center; text-align: center">
|
||||
<img style="height: 900px" src="../../skin/styles/'.EXT_FKT_PATH.'/logo_200x400.png" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="height: 20%; vertical-align: bottom; text-align: right; color: #CCCCCC; padding: 50px">'.$ip.'</td>
|
||||
</tr>
|
||||
</table>
|
||||
';
|
||||
}
|
||||
|
||||
echo '
|
||||
</body>
|
||||
</html>';
|
||||
|
||||
@@ -25,6 +25,7 @@ require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/phrasen.class.php');
|
||||
require_once('../../../include/coodle.class.php');
|
||||
require_once('../../../include/datum.class.php');
|
||||
require_once('../../../include/benutzerberechtigung.class.php');
|
||||
|
||||
$user = get_uid();
|
||||
$sprache = getSprache();
|
||||
@@ -36,6 +37,22 @@ $message='';
|
||||
if(!check_lektor($user))
|
||||
die($p->t('global/keineBerechtigung'));
|
||||
|
||||
// Administratoren duerfen die UID als Parameter uebergeben um die Umfragen von anderen Personen anzuzeigen
|
||||
if(isset($_GET['uid']))
|
||||
{
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user);
|
||||
if($rechte->isBerechtigt('admin'))
|
||||
{
|
||||
$user = $_GET['uid'];
|
||||
$getParam = '&uid='.$user;
|
||||
}
|
||||
else
|
||||
$getParam = '';
|
||||
}
|
||||
else
|
||||
$getParam = '';
|
||||
|
||||
echo '
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
|
||||
@@ -27,6 +27,7 @@ require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/phrasen.class.php');
|
||||
require_once('../../../include/datum.class.php');
|
||||
require_once('../../../include/benutzer.class.php');
|
||||
require_once('../../../include/benutzerberechtigung.class.php');
|
||||
|
||||
$lang = getSprache();
|
||||
|
||||
@@ -35,6 +36,22 @@ $p = new phrasen($lang);
|
||||
$uid = get_uid();
|
||||
$message = '';
|
||||
|
||||
// Administratoren duerfen die UID als Parameter uebergeben um die Umfragen von anderen Personen anzuzeigen
|
||||
if(isset($_GET['uid']))
|
||||
{
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($uid);
|
||||
if($rechte->isBerechtigt('admin'))
|
||||
{
|
||||
$uid = $_GET['uid'];
|
||||
$getParam = '&uid='.$uid;
|
||||
}
|
||||
else
|
||||
$getParam = '';
|
||||
}
|
||||
else
|
||||
$getParam = '';
|
||||
|
||||
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
@@ -170,7 +187,7 @@ foreach($coodle->result as $c)
|
||||
else
|
||||
$title=$p->t('coodle/bearbeiten');
|
||||
|
||||
$row.= ' <a href="stammdaten.php?coodle_id='.$c->coodle_id.'">
|
||||
$row.= ' <a href="stammdaten.php?coodle_id='.$c->coodle_id.'&'.$getParam.'">
|
||||
<img src="../../../skin/images/edit.png" title="'.$title.'">
|
||||
</a>';
|
||||
}
|
||||
|
||||
@@ -48,11 +48,11 @@ if(check_lektor($user))
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<link href="../../../skin/style.css.php" rel="stylesheet" type="text/css">
|
||||
<link rel="stylesheet" type="text/css" href="../../../skin/jquery-ui-1.9.2.custom.min.css">
|
||||
<script type="text/javascript" src="../../../vendor/jquery/jqueryV1/jquery-1.12.4.min.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/christianbach/tablesorter/jquery.tablesorter.min.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/components/jqueryui/jquery-ui.min.js"></script>
|
||||
<script type="text/javascript" src="../../../include/js/jquery.ui.datepicker.translation.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="../../../skin/jquery-ui-1.9.2.custom.min.css">
|
||||
<script type="text/javascript" src="../../../vendor/jquery/jqueryV1/jquery-1.12.4.min.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/christianbach/tablesorter/jquery.tablesorter.min.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/components/jqueryui/jquery-ui.min.js"></script>
|
||||
<script type="text/javascript" src="../../../include/js/jquery.ui.datepicker.translation.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/jquery/sizzle/sizzle.js"></script>
|
||||
<link rel="stylesheet" href="../../../skin/tablesort.css" type="text/css"/>
|
||||
<script type="text/javascript">
|
||||
@@ -175,16 +175,23 @@ if(check_lektor($user))
|
||||
|
||||
<?php
|
||||
$zeilenzaehl=0;
|
||||
$sql_query = "SELECT vorname, nachname, telefonklappe, kontakt, ort_kurzbz, beschreibung, vw_mitarbeiter.standort_id
|
||||
$sql_query = "SELECT vorname, nachname, telefonklappe, kontakt, ort_kurzbz, beschreibung, vw_mitarbeiter.standort_id, uid
|
||||
FROM campus.vw_mitarbeiter
|
||||
JOIN public.tbl_benutzerfunktion USING (uid)
|
||||
JOIN public.tbl_funktion USING (funktion_kurzbz)
|
||||
JOIN public.tbl_kontakt USING (person_id)
|
||||
WHERE funktion_kurzbz='brandbeauftragt'
|
||||
AND (datum_bis>='now()' OR datum_bis IS NULL)
|
||||
AND (
|
||||
datum_von <= 'now()'
|
||||
OR datum_von IS NULL
|
||||
)
|
||||
AND (
|
||||
datum_bis >= 'now()'
|
||||
OR datum_bis IS NULL
|
||||
)
|
||||
AND campus.vw_mitarbeiter.aktiv=TRUE
|
||||
AND vw_mitarbeiter.standort_id IS NOT NULL
|
||||
AND kontakt LIKE '%61925%'
|
||||
AND kontakttyp='firmenhandy'
|
||||
ORDER BY funktion_kurzbz";
|
||||
$result = $db->db_query($sql_query);
|
||||
if ($db->db_num_rows($result) > 0)
|
||||
@@ -202,7 +209,7 @@ if(check_lektor($user))
|
||||
{
|
||||
echo '
|
||||
<tr>
|
||||
<td width="40%">'.$row->nachname.'</td>
|
||||
<td width="40%"><a href="../profile/index.php?uid='.$row->uid.'">'.$row->nachname.'</a></td>
|
||||
<td width="30%">'.$row->vorname.'</td>
|
||||
<td ><nobr>'.$row->kontakt.'</nobr></td>
|
||||
</tr>';
|
||||
@@ -210,23 +217,6 @@ if(check_lektor($user))
|
||||
echo '
|
||||
</tbody></table>';
|
||||
}
|
||||
// An der FHTW wird als Übergangsloesung statisch die Fa. HEALTH COUNSULT als Brandschutzbeauftragte angezeigt
|
||||
if ($db->db_num_rows($result) == 0 && CAMPUS_NAME == 'FH Technikum Wien')
|
||||
{
|
||||
echo '<h2 style="margin-top:0px;">'.$p->t("notfallbestimmungen/brandschutzbeauftragte").'</h2>';
|
||||
echo '<table class="tablesorter" id="t2">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Nummer</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>HEALT COUNSULT - Sicherheitstechnik GmbH</td>
|
||||
<td ><nobr>0650/30 96 909</nobr></td>
|
||||
</tr>
|
||||
</tbody></table>';
|
||||
}
|
||||
?>
|
||||
|
||||
<!--Rektorat auslesen-->
|
||||
|
||||
@@ -120,21 +120,28 @@ if(!$projektarbeit_obj->load($projektarbeit_id))
|
||||
$titel = $projektarbeit_obj->titel;
|
||||
$student_uid = $projektarbeit_obj->student_uid;
|
||||
|
||||
// paarbeit sollte nur ab SS2021 online bewertet werden
|
||||
$qry_sem="SELECT 1
|
||||
FROM lehre.tbl_projektarbeit
|
||||
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
|
||||
JOIN public.tbl_studiensemester USING(studiensemester_kurzbz)
|
||||
WHERE projektarbeit_id=".$db->db_add_param($projektarbeit_id, FHC_INTEGER)."
|
||||
AND tbl_studiensemester.start::date >= (SELECT start FROM public.tbl_studiensemester WHERE studiensemester_kurzbz = 'SS2021')::date
|
||||
LIMIT 1";
|
||||
$result_sem=$db->db_query($qry_sem);
|
||||
$num_rows_sem = $db->db_num_rows($result_sem);
|
||||
if($num_rows_sem < 0)
|
||||
// paarbeit sollte nur ab bestimmten Zeitpunkt online bewertet werden
|
||||
$num_rows_sem = $projektarbeit_obj->projektarbeitIsCurrent($projektarbeit_id);
|
||||
|
||||
if(!is_numeric($num_rows_sem) || $num_rows_sem < 0)
|
||||
{
|
||||
echo "<font color=\"#FF0000\">".$p->t('abgabetool/fehlerAktualitaetProjektarbeit')."</font><br> ";
|
||||
}
|
||||
|
||||
// Endupload sollte vor Benotung durchgeführt worden sein
|
||||
$qry_endupload="SELECT 1
|
||||
FROM campus.tbl_paabgabe
|
||||
WHERE projektarbeit_id=".$db->db_add_param($projektarbeit_id, FHC_INTEGER)."
|
||||
AND paabgabetyp_kurzbz='end'
|
||||
AND abgabedatum IS NOT NULL
|
||||
LIMIT 1";
|
||||
$result_endupload=$db->db_query($qry_endupload);
|
||||
$num_rows_endupload = $db->db_num_rows($result_endupload);
|
||||
if($num_rows_endupload < 0)
|
||||
{
|
||||
echo "<font color=\"#FF0000\">".$p->t('abgabetool/fehlerErmittelnEnduploadProjektarbeit')."</font><br> ";
|
||||
}
|
||||
|
||||
// Zweitbegutachter holen
|
||||
if($betreuerart=="Erstbegutachter")
|
||||
{
|
||||
@@ -457,7 +464,11 @@ while ($result_nam && $row_nam=$db->db_fetch_object($result_nam))
|
||||
$htmlstr .= "<table id='beurteilungheadertable' width=100%>\n";
|
||||
$htmlstr .= "<tr><td style='font-size:16px'>".$p->t('abgabetool/student').": <b>".$db->convert_html_chars($studentenname)."</b></td>";
|
||||
$htmlstr .= "<td width=10% align=center>";
|
||||
if ($num_rows_sem >= 1)
|
||||
|
||||
$semester_benotbar = $num_rows_sem >= 1;
|
||||
$endupload_vorhanden = $num_rows_endupload >= 1;
|
||||
|
||||
if ($semester_benotbar && $endupload_vorhanden)
|
||||
{
|
||||
$htmlstr .= "<form action='../../../index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/Projektarbeitsbeurteilung' title='Benotungsformular' target='_blank' method='GET'>";
|
||||
$htmlstr .= "<input type='hidden' name='projektarbeit_id' value='".$projektarbeit_id."'>\n";
|
||||
@@ -466,9 +477,10 @@ if ($num_rows_sem >= 1)
|
||||
}
|
||||
else
|
||||
{
|
||||
$quick_info = !$semester_benotbar ? $p->t('abgabetool/aeltereParbeitBenoten') : $p->t('abgabetool/keinEnduploadErfolgt');
|
||||
$htmlstr .= "<form action='javascript:void(0);'>";
|
||||
$htmlstr .= "<input type='submit' value='".$p->t('abgabetool/benoten')."' title='".$p->t('abgabetool/aeltereParbeitBenoten')."'
|
||||
alt='".$p->t('abgabetool/aeltereParbeitBenoten')."' disabled>";
|
||||
$htmlstr .= "<input type='submit' value='".$p->t('abgabetool/benoten')."' title='".$quick_info."'
|
||||
alt='".$quick_info."' disabled>";
|
||||
$htmlstr .= "</form>";
|
||||
}
|
||||
$htmlstr .= "</td>";
|
||||
|
||||
@@ -423,18 +423,9 @@ if($command=="update" && $error!=true)
|
||||
}
|
||||
else
|
||||
{
|
||||
// paarbeit sollte nur ab SS2021 online bewertet werden
|
||||
$qry_sem="SELECT 1
|
||||
FROM lehre.tbl_projektarbeit
|
||||
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
|
||||
JOIN public.tbl_studiensemester USING(studiensemester_kurzbz)
|
||||
WHERE projektarbeit_id=".$db->db_add_param($projektarbeit_id, FHC_INTEGER)."
|
||||
AND tbl_studiensemester.start::date >= (SELECT start FROM public.tbl_studiensemester WHERE studiensemester_kurzbz = 'SS2021')::date
|
||||
LIMIT 1";
|
||||
|
||||
$result_sem=$db->db_query($qry_sem);
|
||||
$num_rows_sem = $db->db_num_rows($result_sem);
|
||||
if($num_rows_sem < 0)
|
||||
// paarbeit sollte nur ab bestimmten Zeitpunkt online bewertet werden
|
||||
$num_rows_sem = $projektarbeit_obj->projektarbeitIsCurrent($projektarbeit_id);
|
||||
if(!is_numeric($num_rows_sem) || $num_rows_sem < 0)
|
||||
{
|
||||
echo "<font color=\"#FF0000\">".$p->t('abgabetool/fehlerAktualitaetProjektarbeit')."</font><br> ";
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ isset($_GET['lehreinheit_id']) ? $lehreinheit = $_GET['lehreinheit_id'] : $lehre
|
||||
$stg = new studiengang();
|
||||
$stg->load($lv->studiengang_kz);
|
||||
|
||||
$doc = new dokument_export('Anwesenheitslist');
|
||||
$doc = new dokument_export('Anwesenheitslist', $stg->oe_kurzbz);
|
||||
|
||||
$lehrelisthelper = new LehreListHelper($db, $studiensemester, $lvid, $lv, $stg, $lehreinheit);
|
||||
$arr_lehrende = $lehrelisthelper->getArr_Lehrende();
|
||||
|
||||
@@ -237,6 +237,10 @@ $covidhelper = new CovidHelper();
|
||||
$aw_content='';
|
||||
if(defined('CIS_ANWESENHEITSLISTE_ANWESENHEITSLISTE_BILD_ANZEIGEN') && !CIS_ANWESENHEITSLISTE_ANWESENHEITSLISTE_BILD_ANZEIGEN)
|
||||
$awbild_content='';
|
||||
if( defined('CIS_SHOW_COVID_STATUS') && !CIS_SHOW_COVID_STATUS )
|
||||
{
|
||||
$covid_content = '';
|
||||
}
|
||||
|
||||
echo "<table cellpadding='0' cellspacing='0'>
|
||||
|
||||
|
||||
@@ -736,6 +736,7 @@ else
|
||||
die($p->t('global/fehleraufgetreten'));
|
||||
|
||||
// Kopfzeile
|
||||
|
||||
echo '
|
||||
<table width="100%">
|
||||
<tr>
|
||||
@@ -1144,7 +1145,7 @@ if (defined("CIS_GESAMTNOTE_PRUEFUNG_MOODLE_LE_NOTE") && CIS_GESAMTNOTE_PRUEFUNG
|
||||
$eintrag = '';
|
||||
foreach ($output as $k)
|
||||
{
|
||||
if($k->mobilitaetstyp_kurzbz == 'GS')
|
||||
if(($k->mobilitaetstyp_kurzbz == 'GS') && ($k->studiensemester_kurzbz == $stsem))
|
||||
$eintrag = ' (d.d.)';
|
||||
}
|
||||
$grades[$row_stud->uid]['mobility'] = $eintrag;
|
||||
@@ -1191,6 +1192,7 @@ if (defined("CIS_GESAMTNOTE_PRUEFUNG_MOODLE_LE_NOTE") && CIS_GESAMTNOTE_PRUEFUNG
|
||||
foreach ($grades as $uid => $data)
|
||||
//Ausgabe Array
|
||||
{
|
||||
|
||||
$htmlstring .= '<tr class="liste' . ($i % 2) . '">
|
||||
<td><a href="mailto:' . $uid . '@' . DOMAIN . '"><img src="../../../../skin/images/button_mail.gif"></a></td>
|
||||
<td>' . $db->convert_html_chars($uid) . '</td>
|
||||
@@ -1218,6 +1220,7 @@ if (defined("CIS_GESAMTNOTE_PRUEFUNG_MOODLE_LE_NOTE") && CIS_GESAMTNOTE_PRUEFUNG
|
||||
$negativeteilnote = false;
|
||||
$note_zusatztext = '';
|
||||
$note_zusatztext_tooltip = '';
|
||||
$ueberschreibbar = false; //Damit keine Notice Fehler kommt muss Variable bei jeden Schleifendurchgang neue gesetzt und berechnet werden.
|
||||
|
||||
if (isset($data['grades']))
|
||||
{
|
||||
|
||||
@@ -37,7 +37,6 @@ require_once('../../../include/erhalter.class.php');
|
||||
require_once('../../../include/datum.class.php');
|
||||
|
||||
|
||||
$doc = new dokument_export('fotoliste');
|
||||
$output = 'pdf';
|
||||
$show_all_fotos = false;
|
||||
|
||||
@@ -62,6 +61,8 @@ $lv->load($lvid);
|
||||
$stg = new studiengang();
|
||||
$stg->load($lv->studiengang_kz);
|
||||
|
||||
$doc = new dokument_export('fotoliste', $stg->oe_kurzbz);
|
||||
|
||||
$berechtigung = new benutzerberechtigung();
|
||||
$berechtigung->getBerechtigungen($user);
|
||||
|
||||
@@ -224,8 +225,9 @@ if ($result = $db->db_query($qry)) {
|
||||
else
|
||||
$zusatz = '';
|
||||
|
||||
if ($row->bisio_id != '' && $row->status != 'Incoming' && ($row->bis > $stsemdatumvon || $row->bis == '') && $row->von < $stsemdatumbis) //Outgoing
|
||||
$zusatz .= '(o)(ab ' . $datum->formatDatum($row->von, 'd.m.Y') . ')';
|
||||
if ($row->bisio_id != '' && $row->status != 'Incoming' && ($row->bis > $stsemdatumvon || $row->bis == '') && $row->von < $stsemdatumbis
|
||||
&& (anzahlTage($row->von, $row->bis) >= 30)) //Outgoing
|
||||
$zusatz .= '(o)(ab '. $datum->formatDatum($row->von, 'd.m.Y'). ')';
|
||||
|
||||
if ($row->note == 6) //angerechnet
|
||||
$zusatz .= '(ar)';
|
||||
|
||||
@@ -197,8 +197,10 @@ else
|
||||
{
|
||||
$prestudent->getFirstStatus($prestudent_id, 'Student');
|
||||
$firstStudiensemester = $prestudent->studiensemester_kurzbz;
|
||||
$prestudent->getLastStatus($prestudent_id, null, 'Student');
|
||||
$lastStudiensemester = $prestudent->studiensemester_kurzbz;
|
||||
if ($prestudent->getLastStatus($prestudent_id, null, 'Diplomand'))
|
||||
$lastStudiensemester = $prestudent->studiensemester_kurzbz;
|
||||
elseif ($prestudent->getLastStatus($prestudent_id, null, 'Student'))
|
||||
$lastStudiensemester = $prestudent->studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
$stsem_obj->getStudiensemesterBetween($firstStudiensemester, $lastStudiensemester);
|
||||
@@ -241,7 +243,7 @@ else
|
||||
$qry = "SELECT
|
||||
tbl_lehrveranstaltung.lehrveranstaltung_id, tbl_zeugnisnote.note, tbl_zeugnisnote.punkte,
|
||||
tbl_lvgesamtnote.note as lvnote, tbl_lvgesamtnote.punkte as lvpunkte,
|
||||
tbl_zeugnisnote.benotungsdatum, tbl_lvgesamtnote.freigabedatum,
|
||||
tbl_zeugnisnote.benotungsdatum, tbl_lvgesamtnote.freigabedatum, tbl_zeugnisnote.uebernahmedatum,
|
||||
tbl_lvgesamtnote.benotungsdatum as lvbenotungsdatum,
|
||||
tbl_zeugnisnote.studiensemester_kurzbz AS studiensemester_zeugnis, tbl_lvgesamtnote.studiensemester_kurzbz AS studiensemester_lvnote,
|
||||
tbl_lehrveranstaltung.zeugnis, tbl_lehrveranstaltung.ects
|
||||
@@ -354,6 +356,7 @@ else
|
||||
|
||||
if (count($pruefung->result) > 0)
|
||||
{
|
||||
$freigabedatum = $row->uebernahmedatum;
|
||||
$tblBody .= '<td>';
|
||||
foreach ($pruefung->result as $row)
|
||||
{
|
||||
@@ -367,7 +370,8 @@ else
|
||||
else
|
||||
$punkte = '';
|
||||
|
||||
$tblBody .= $row->pruefungstyp_beschreibung . ' ' . $datum_obj->formatDatum($row->datum, 'd.m.Y') . ' ' . $note . $punkte . '<br>';
|
||||
if ($datum_obj->formatDatum($freigabedatum, "Y-m-d") >= $row->datum)
|
||||
$tblBody .= $row->pruefungstyp_beschreibung . ' ' . $datum_obj->formatDatum($row->datum, 'd.m.Y') . ' ' . $note . $punkte . '<br>';
|
||||
}
|
||||
$tblBody .= '</td>';
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
|
||||
* Rudolf Hangl < rudolf.hangl@technikum-wien.at >
|
||||
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
|
||||
* Manuela Thamer <manuela.thamer@technikum-wien.at>
|
||||
*/
|
||||
/*
|
||||
* Erstellt Notenliste im Excel Format
|
||||
@@ -37,6 +38,8 @@ require_once('../../../include/phrasen.class.php');
|
||||
|
||||
$uid = get_uid();
|
||||
|
||||
|
||||
|
||||
$sprache = getSprache();
|
||||
$p = new phrasen($sprache);
|
||||
|
||||
@@ -111,6 +114,12 @@ else
|
||||
$format_highlight->setBorder(1);
|
||||
$format_highlight->setBorderColor('white');
|
||||
|
||||
$format_highlightright=& $workbook->addFormat();
|
||||
$format_highlightright->setFgColor(15);
|
||||
$format_highlightright->setBorder(1);
|
||||
$format_highlightright->setBorderColor('white');
|
||||
$format_highlightright->setAlign('right');
|
||||
|
||||
$format_border_bottom =& $workbook->addFormat();
|
||||
$format_border_bottom ->setBottom(2);
|
||||
$format_border_bottom->setBold();
|
||||
@@ -199,32 +208,37 @@ else
|
||||
$stsemdatumvon = $stsem_obj->start;
|
||||
$stsemdatumbis = $stsem_obj->ende;
|
||||
|
||||
$qry = "SELECT
|
||||
distinct on(nachname, vorname, person_id) vorname, nachname, matrikelnr, person_id, tbl_student.student_uid as uid,
|
||||
tbl_studentlehrverband.semester, tbl_studentlehrverband.verband, tbl_studentlehrverband.gruppe,
|
||||
(SELECT status_kurzbz
|
||||
FROM public.tbl_prestudentstatus
|
||||
WHERE prestudent_id=tbl_student.prestudent_id
|
||||
ORDER BY datum DESC, insertamum DESC, ext_id DESC LIMIT 1) as status,
|
||||
tbl_bisio.bisio_id, tbl_bisio.bis, tbl_bisio.von,
|
||||
tbl_zeugnisnote.note,tbl_mobilitaet.mobilitaetstyp_kurzbz
|
||||
$qry = "
|
||||
SELECT
|
||||
distinct on(nachname, vorname, person_id)
|
||||
vorname, nachname, matrikelnr, person_id, tbl_student.student_uid as uid,
|
||||
tbl_studentlehrverband.semester, tbl_studentlehrverband.verband, tbl_studentlehrverband.gruppe,
|
||||
(SELECT status_kurzbz
|
||||
FROM public.tbl_prestudentstatus
|
||||
WHERE prestudent_id=tbl_student.prestudent_id
|
||||
ORDER BY datum DESC, insertamum DESC, ext_id DESC LIMIT 1) as status,
|
||||
tbl_bisio.bisio_id, tbl_bisio.bis, tbl_bisio.von,
|
||||
tbl_zeugnisnote.note,tbl_mobilitaet.mobilitaetstyp_kurzbz,
|
||||
(CASE WHEN bis.tbl_mobilitaet.studiensemester_kurzbz = vw_student_lehrveranstaltung.studiensemester_kurzbz THEN '1' ELSE '' END) as doubledegree,
|
||||
tbl_note.lkt_ueberschreibbar, tbl_note.anmerkung
|
||||
FROM
|
||||
campus.vw_student_lehrveranstaltung JOIN public.tbl_benutzer USING(uid)
|
||||
JOIN public.tbl_person USING(person_id) JOIN public.tbl_student ON(uid=student_uid)
|
||||
LEFT JOIN public.tbl_studentlehrverband USING(student_uid,studiensemester_kurzbz)
|
||||
LEFT JOIN lehre.tbl_zeugnisnote on(vw_student_lehrveranstaltung.lehrveranstaltung_id=tbl_zeugnisnote.lehrveranstaltung_id
|
||||
AND tbl_zeugnisnote.student_uid=tbl_student.student_uid
|
||||
AND tbl_zeugnisnote.studiensemester_kurzbz=tbl_studentlehrverband.studiensemester_kurzbz)
|
||||
LEFT JOIN bis.tbl_bisio ON(uid=tbl_bisio.student_uid)
|
||||
LEFT JOIN bis.tbl_mobilitaet USING(prestudent_id)
|
||||
campus.vw_student_lehrveranstaltung JOIN public.tbl_benutzer USING(uid)
|
||||
JOIN public.tbl_person USING(person_id) JOIN public.tbl_student ON(uid=student_uid)
|
||||
LEFT JOIN public.tbl_studentlehrverband USING(student_uid,studiensemester_kurzbz)
|
||||
LEFT JOIN lehre.tbl_zeugnisnote on(vw_student_lehrveranstaltung.lehrveranstaltung_id=tbl_zeugnisnote.lehrveranstaltung_id
|
||||
AND tbl_zeugnisnote.student_uid=tbl_student.student_uid
|
||||
AND tbl_zeugnisnote.studiensemester_kurzbz=tbl_studentlehrverband.studiensemester_kurzbz)
|
||||
LEFT JOIN bis.tbl_bisio ON(uid=tbl_bisio.student_uid)
|
||||
LEFT JOIN bis.tbl_mobilitaet USING(prestudent_id)
|
||||
LEFT JOIN lehre.tbl_note USING(note)
|
||||
WHERE
|
||||
vw_student_lehrveranstaltung.lehrveranstaltung_id=".$db->db_add_param($lvid, FHC_INTEGER)." AND
|
||||
vw_student_lehrveranstaltung.studiensemester_kurzbz=".$db->db_add_param($stsem);";";
|
||||
vw_student_lehrveranstaltung.lehrveranstaltung_id=".$db->db_add_param($lvid, FHC_INTEGER)."
|
||||
AND vw_student_lehrveranstaltung.studiensemester_kurzbz=".$db->db_add_param($stsem);";";
|
||||
|
||||
if($lehreinheit_id!='')
|
||||
$qry.=" AND vw_student_lehrveranstaltung.lehreinheit_id=".$db->db_add_param($lehreinheit_id, FHC_INTEGER);
|
||||
|
||||
$qry.=' ORDER BY nachname, vorname, person_id, tbl_bisio.bis DESC';
|
||||
$qry.=' ORDER BY nachname, vorname, person_id, tbl_bisio.bis, doubledegree DESC';
|
||||
|
||||
if($result = $db->db_query($qry))
|
||||
{
|
||||
@@ -232,6 +246,7 @@ else
|
||||
$lines++;
|
||||
while($elem = $db->db_fetch_object($result))
|
||||
{
|
||||
$note='';
|
||||
if(!preg_match('*dummy*',$elem->uid) && $elem->semester!=10)
|
||||
{
|
||||
if($elem->status!='Abbrecher' && $elem->status!='Unterbrecher')
|
||||
@@ -241,26 +256,30 @@ else
|
||||
$inc=' (i)';
|
||||
else
|
||||
$inc='';
|
||||
if($elem->bisio_id!='' && $elem->status!='Incoming' && ($elem->bis > $stsemdatumvon || $elem->bis=='') && $elem->von < $stsemdatumbis) //Outgoing
|
||||
$inc.=' (o)';
|
||||
|
||||
if($elem->note==6) //angerechnet
|
||||
if($elem->bisio_id != '' && $elem->status != 'Incoming' && ($elem->bis > $stsemdatumvon || $elem->bis == '')
|
||||
&& $elem->von < $stsemdatumbis && (anzahlTage($elem->von, $elem->bis) >= 30))
|
||||
$inc.=' (o)';
|
||||
|
||||
$note = $elem->note;
|
||||
|
||||
if($elem->lkt_ueberschreibbar == 'f') // angerechnet / intern angerechnet / nicht zugelassen
|
||||
{
|
||||
$inc.=' (ar)';
|
||||
$note='ar';
|
||||
$inc.= '('. $elem->anmerkung. ')';
|
||||
$note = $elem->anmerkung;
|
||||
}
|
||||
if($elem->mobilitaetstyp_kurzbz !='') //dd-Program
|
||||
|
||||
if ($elem->mobilitaetstyp_kurzbz !='' && $elem->doubledegree == 1) //dd-Program
|
||||
{
|
||||
$inc.=' (dd)';
|
||||
$inc .=' (d.d.)';
|
||||
}
|
||||
else
|
||||
$note='';
|
||||
|
||||
$worksheet->write($lines,1,$elem->uid);
|
||||
$worksheet->write($lines,2,$elem->nachname.$inc);
|
||||
$worksheet->write($lines,3,$elem->vorname);
|
||||
$worksheet->write($lines,4,'="'.$elem->semester.$elem->verband.$elem->gruppe.'"');
|
||||
$worksheet->write($lines,5,'="'.trim($elem->matrikelnr).'"',$format_highlight);
|
||||
$worksheet->write($lines,6,$note,$format_highlight);
|
||||
$worksheet->write($lines,6, $note, $format_highlightright);
|
||||
$i++;
|
||||
$lines++;
|
||||
}
|
||||
@@ -305,7 +324,8 @@ else
|
||||
$worksheet->write(++$lines,0,'(i) ... Incoming');
|
||||
$worksheet->write(++$lines,0,'(o) ... Outgoing');
|
||||
$worksheet->write(++$lines,0,'(ar) ... '.$p->t('anwesenheitsliste/angerechnet'));
|
||||
$worksheet->write(++$lines,0,'(dd) ... Double Degree Program');
|
||||
$worksheet->write(++$lines,0,'(iar) ... '.$p->t('anwesenheitsliste/internangerechnet'));
|
||||
$worksheet->write(++$lines,0,'(d.d.) ... Double Degree Program');
|
||||
|
||||
$worksheet->setColumn(0, 0, 5);
|
||||
$worksheet->setColumn(0, 1, 16);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
$url = "https://xgnd.bsz-bw.de/";
|
||||
$url = "https://ognd.bsz-bw.de/";
|
||||
$zielfeld = "kontrollschlagwoerter";
|
||||
$url = $url."?zielfeld=".$zielfeld;
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user