mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 02:12:17 +00:00
Merge branch 'master' into feature-6656/Worker_queue
This commit is contained in:
@@ -284,9 +284,11 @@ class Messages_model extends CI_Model
|
||||
|
||||
$sender = getData($senderResult)[0]; // Found sender data
|
||||
|
||||
// If the sender is not the system sender and are present configurations to reply
|
||||
// If the sender is not the system sender and the receiver is not the system sender
|
||||
// and are present configurations to reply
|
||||
$hrefReply = '';
|
||||
if ($message->sender_id != $this->config->item(MessageLib::CFG_SYSTEM_PERSON_ID)
|
||||
&& $message->receiver_id != $this->config->item(MessageLib::CFG_SYSTEM_PERSON_ID)
|
||||
&& !isEmptyString($this->config->item(MessageLib::CFG_REDIRECT_VIEW_MESSAGE_URL)))
|
||||
{
|
||||
$hrefReply = $this->config->item(MessageLib::CFG_MESSAGE_SERVER).
|
||||
@@ -294,6 +296,13 @@ class Messages_model extends CI_Model
|
||||
$token;
|
||||
}
|
||||
|
||||
// If the receiver is the system sender (the message was sent to an organization unit)
|
||||
// redirect the reply to an authenticated controller to reply
|
||||
if ($message->receiver_id == $this->config->item(MessageLib::CFG_SYSTEM_PERSON_ID))
|
||||
{
|
||||
$hrefReply = site_url('system/messages/MessageClient/writeReply?token='.$token);
|
||||
}
|
||||
|
||||
return array (
|
||||
'sender' => $sender,
|
||||
'message' => $message,
|
||||
|
||||
@@ -26,7 +26,7 @@ class Abschlusspruefung_model extends DB_Model
|
||||
|
||||
$abschlusspruefungdata = array();
|
||||
|
||||
$this->addSelect('tbl_abschlusspruefung.abschlusspruefung_id, tbl_abschlusspruefung.datum, tbl_abschlusspruefung.abschlussbeurteilung_kurzbz, tbl_abschlusspruefung.uhrzeit AS pruefungsbeginn, tbl_abschlusspruefung.endezeit AS pruefungsende,
|
||||
$this->addSelect('tbl_abschlusspruefung.abschlusspruefung_id, tbl_abschlusspruefung.datum, tbl_abschlusspruefung.pruefungstyp_kurzbz AS studiengangstyp, tbl_abschlusspruefung.abschlussbeurteilung_kurzbz, tbl_abschlusspruefung.uhrzeit AS pruefungsbeginn, tbl_abschlusspruefung.endezeit AS pruefungsende,
|
||||
tbl_abschlusspruefung.freigabedatum, tbl_abschlusspruefung_antritt.bezeichnung AS pruefungsantritt_bezeichnung, tbl_abschlusspruefung_antritt.bezeichnung_english AS pruefungsantritt_bezeichnung_english, tbl_abschlusspruefung.protokoll,
|
||||
studentpers.vorname AS vorname_student, studentpers.nachname AS nachname_student, studentpers.titelpre AS titelpre_student, studentpers.titelpost AS titelpost_student, studentben.uid AS uid_student, matrikelnr,
|
||||
vorsitzenderben.uid AS uid_vorsitz, vorsitzenderpers.vorname AS vorname_vorsitz, vorsitzenderpers.nachname AS nachname_vorsitz, vorsitzenderpers.titelpre AS titelpre_vorsitz, vorsitzenderpers.titelpost AS titelpost_vorsitz,
|
||||
@@ -71,29 +71,42 @@ class Abschlusspruefung_model extends DB_Model
|
||||
$abschlusspruefungdata->studiengang_kz = $studienordnungdata->studiengang_kz;
|
||||
$abschlusspruefungdata->studiengangbezeichnung = $studienordnungdata->studiengangbezeichnung;
|
||||
$abschlusspruefungdata->studiengangbezeichnung_englisch = $studienordnungdata->studiengangbezeichnung_englisch;
|
||||
|
||||
$this->StudiengangModel->addSelect('typ');
|
||||
$typ = $this->StudiengangModel->load($studienordnungdata->studiengang_kz);
|
||||
if (isError($typ))
|
||||
return $typ;
|
||||
elseif (hasData($typ))
|
||||
}
|
||||
// if no Studienordnung available (e.g. Incomings), use Studiengangname provided by table student
|
||||
elseif (!hasData($studienordnung))
|
||||
{
|
||||
$this->resetQuery();
|
||||
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->addSelect('studiengang_kz, bezeichnung, english');
|
||||
$this->addJoin('public.tbl_studiengang', 'studiengang_kz');
|
||||
$result = $this->StudentModel->load(array(
|
||||
'student_uid' => $student_uid)
|
||||
);
|
||||
|
||||
if ($result = getData($result)[0])
|
||||
{
|
||||
$abschlusspruefungdata->studiengangstyp = getData($typ)[0]->typ;
|
||||
$abschlusspruefungdata->studiengang_kz = $result->studiengang_kz;
|
||||
$abschlusspruefungdata->studiengangbezeichnung = $result->bezeichnung;
|
||||
$abschlusspruefungdata->studiengangbezeichnung_englisch = $result->english;
|
||||
}
|
||||
|
||||
// get Abschlussarbeit
|
||||
}
|
||||
|
||||
// get Abschlussarbeit
|
||||
if (isset($abschlusspruefungdata->studiengang_kz) && !empty($abschlusspruefungdata->studiengang_kz))
|
||||
{
|
||||
$projekttyp = array('Bachelor','Diplom','Master','Dissertation','Lizenziat','Magister');
|
||||
$abschlussarbeit = $this->ProjektarbeitModel->getProjektarbeit($student_uid, $studienordnungdata->studiengang_kz, null, $projekttyp, true);
|
||||
$abschlussarbeit = $this->ProjektarbeitModel->getProjektarbeit($student_uid, $abschlusspruefungdata->studiengang_kz, null, $projekttyp, true);
|
||||
|
||||
if (isError($abschlussarbeit))
|
||||
return $abschlussarbeit;
|
||||
if (hasData($abschlussarbeit))
|
||||
{
|
||||
$abschlussarbeit = getData($abschlussarbeit)[0];
|
||||
$abschlusspruefungdata->projektarbeit_studiengangstyp_name = $abschlussarbeit->projekttyp_kurzbz;
|
||||
$abschlusspruefungdata->abschlussarbeit_titel = $abschlussarbeit->titel;
|
||||
$abschlusspruefungdata->abschlussarbeit_note = $abschlussarbeit->note;
|
||||
}
|
||||
$abschlussarbeit = getData($abschlussarbeit)[0];
|
||||
$abschlusspruefungdata->projektarbeit_studiengangstyp_name = $abschlussarbeit->projekttyp_kurzbz;
|
||||
$abschlusspruefungdata->abschlussarbeit_titel = $abschlussarbeit->titel;
|
||||
$abschlusspruefungdata->abschlussarbeit_note = $abschlussarbeit->note;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,12 +14,14 @@ class Adresse_model extends DB_Model
|
||||
|
||||
|
||||
/**
|
||||
* gets person data from uid
|
||||
* @param $uid
|
||||
* Get Zustelladress of given person.
|
||||
* @param string $person_id
|
||||
* @param string $select
|
||||
* @return array
|
||||
*/
|
||||
public function getZustellAdresse($person_id)
|
||||
public function getZustellAdresse($person_id, $select = '*')
|
||||
{
|
||||
$this->addSelect($select);
|
||||
return $this->loadWhere(array('person_id' => $person_id, 'zustelladresse'=> true));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,4 +119,54 @@ class Kontakt_model extends DB_Model
|
||||
}
|
||||
return $firmentelefon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all latest contact data of person, where Zustellung is true
|
||||
* @param $person_id
|
||||
* @return array
|
||||
*/
|
||||
public function getAll_byPersonID($person_id)
|
||||
{
|
||||
$this->addSelect('DISTINCT ON (kontakttyp) kontakttyp, kontakt');
|
||||
$this->addJoin('public.tbl_standort', 'standort_id', 'LEFT');
|
||||
$this->addJoin('public.tbl_firma', 'firma_id', 'LEFT');
|
||||
$this->addOrder('kontakttyp, kontakt, tbl_kontakt.updateamum, tbl_kontakt.insertamum');
|
||||
|
||||
return $this->loadWhere(array(
|
||||
'zustellung' => TRUE,
|
||||
'person_id' => $person_id
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all latest phones of person where zustellung is true. Ordered by
|
||||
* telefon > mobil > firmenhandy > else.
|
||||
* @param string person_id
|
||||
*/
|
||||
public function getPhones_byPerson($person_id)
|
||||
{
|
||||
$qry = '
|
||||
WITH latest_phones AS(
|
||||
SELECT DISTINCT ON (kontakttyp) kontakttyp, kontakt
|
||||
FROM public.tbl_kontakt kontakt
|
||||
LEFT JOIN public.tbl_standort USING (standort_id)
|
||||
LEFT JOIN public.tbl_firma USING (firma_id)
|
||||
WHERE person_id = ?
|
||||
AND zustellung
|
||||
AND kontakttyp IN (\'telefon\', \'mobil\', \'firmenhandy\')
|
||||
ORDER BY kontakttyp, kontakt, kontakt.updateamum
|
||||
)
|
||||
|
||||
SELECT * FROM latest_phones
|
||||
ORDER BY
|
||||
CASE
|
||||
WHEN kontakttyp = \'telefon\' THEN 0
|
||||
WHEN kontakttyp = \'mobil\' THEN 1
|
||||
WHEN kontakttyp = \'firmenhandy\' THEN 2
|
||||
ELSE 3
|
||||
END
|
||||
';
|
||||
|
||||
return $this->execQuery($qry, array($person_id));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
class Betriebsmittelperson_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@@ -11,4 +10,45 @@ class Betriebsmittelperson_model extends DB_Model
|
||||
$this->dbTable = 'wawi.tbl_betriebsmittelperson';
|
||||
$this->pk = 'betriebsmittelperson_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Betriebsmittel by person.
|
||||
* @param string $person_id
|
||||
* @param string $betriebsmitteltyp
|
||||
* @param bool $isRetourniert False to retrieve only active Betriebsmittel.
|
||||
* @return array|bool
|
||||
*/
|
||||
public function getBetriebsmittel($person_id, $betriebsmitteltyp = null, $isRetourniert = null)
|
||||
{
|
||||
if (!is_numeric($person_id))
|
||||
{
|
||||
$this->errormsg = 'Person_id type is not valid.';
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->addJoin('wawi.tbl_betriebsmittel', 'betriebsmittel_id');
|
||||
|
||||
$condition = '
|
||||
person_id = '. $this->escape($person_id). '
|
||||
';
|
||||
|
||||
if (is_string($betriebsmitteltyp)) {
|
||||
$condition .= '
|
||||
AND betriebsmitteltyp = ' . $this->escape($betriebsmitteltyp);
|
||||
}
|
||||
|
||||
if ($isRetourniert === true) {
|
||||
$condition .= '
|
||||
AND retouram IS NOT NULL'; // return date is given
|
||||
}
|
||||
elseif ($isRetourniert === false)
|
||||
{
|
||||
$condition .= '
|
||||
AND retouram IS NULL'; // default
|
||||
}
|
||||
|
||||
$this->addOrder('ausgegebenam', 'DESC'); // default
|
||||
|
||||
return $this->loadWhere($condition);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user