Infocenter message Quereinsteiger Freigabe

- Orgform bezeichnung shown in german and english
Infocenter Controller changes
- constants for Interessent and Abgewiesener names added
- removed unnecessary parameters in comments
crm/Prestudent_model
- fixed typo
This commit is contained in:
alex
2019-06-03 16:30:44 +02:00
parent ff31397bc5
commit 05a049edca
5 changed files with 83 additions and 37 deletions
@@ -65,6 +65,10 @@ class InfoCenter extends Auth_Controller
)
);
// Name of Interessentenstatus
const INTERESSENTSTATUS = 'Interessent';
const ABGEWIESENERSTATUS = 'Abgewiesener';
// Statusgruende for which no Studiengangsfreigabemessage should be sent
private $_statusgruendeNoStgFreigabeMessage = array('FIT Programm', 'FIT program', 'FIT programme');
@@ -171,7 +175,6 @@ class InfoCenter extends Auth_Controller
/**
* Personal details page of the InfoCenter tool
* Initialization function, gets person and prestudent data and loads the view with the data
* @param $person_id
*/
public function showDetails()
{
@@ -346,7 +349,6 @@ class InfoCenter extends Auth_Controller
/**
* Saves a ZGV for a prestudent, includes Ort, Datum, Nation for bachelor and master
* @param $prestudent_id
*/
public function saveZgvPruefung()
{
@@ -375,7 +377,7 @@ class InfoCenter extends Auth_Controller
$zgvmadatum = isEmptyString($zgvmadatum) ? null : date_format(date_create($zgvmadatum), 'Y-m-d');
$zgvmanation_code = $this->input->post('zgvmanation') === 'null' ? null : $this->input->post('zgvmanation');
$lastStatus = $this->PrestudentstatusModel->getLastStatus($prestudent_id, '', 'Interessent');
$lastStatus = $this->PrestudentstatusModel->getLastStatus($prestudent_id, '', self::INTERESSENTSTATUS);
$semresult = null;
@@ -426,7 +428,6 @@ class InfoCenter extends Auth_Controller
/**
* Saves Absage for Prestudent including the reason for the Absage (statusgrund).
* inserts Studiensemester and Ausbildungssemester for the new Absage of (chronologically) last status.
* @param $prestudent_id
*/
public function saveAbsage()
{
@@ -442,7 +443,7 @@ class InfoCenter extends Auth_Controller
if (hasData($lastStatus) && hasData($statusgrresult))
{
//check if still Interessent and not freigegeben yet
if ($lastStatus->retval[0]->status_kurzbz === 'Interessent' && !isset($lastStatus->retval[0]->bestaetigtam))
if ($lastStatus->retval[0]->status_kurzbz === self::INTERESSENTSTATUS && !isset($lastStatus->retval[0]->bestaetigtam))
{
$result = $this->PrestudentstatusModel->insert(
array(
@@ -452,7 +453,7 @@ class InfoCenter extends Auth_Controller
'datum' => date('Y-m-d'),
'orgform_kurzbz' => $lastStatus->retval[0]->orgform_kurzbz,
'studienplan_id' => $lastStatus->retval[0]->studienplan_id,
'status_kurzbz' => 'Abgewiesener',
'status_kurzbz' => self::ABGEWIESENERSTATUS,
'statusgrund_id' => $statusgrund,
'insertvon' => $this->_uid,
'insertamum' => date('Y-m-d H:i:s')
@@ -478,7 +479,6 @@ class InfoCenter extends Auth_Controller
/**
* Saves Freigabe of a Prestudent to the Studiengang.
* updates bestaetigtam and bestaetigtvon fields of the last status
* @param $prestudent_id
*/
public function saveFreigabe()
{
@@ -497,7 +497,7 @@ class InfoCenter extends Auth_Controller
$lastStatus = $lastStatus->retval[0];
//check if still Interessent and not freigegeben yet
if ($lastStatus->status_kurzbz === 'Interessent' && !isset($lastStatus->bestaetigtam))
if ($lastStatus->status_kurzbz === self::INTERESSENTSTATUS && !isset($lastStatus->bestaetigtam))
{
$statusdata = array(
'bestaetigtvon' => $this->_uid,
@@ -599,7 +599,6 @@ class InfoCenter extends Auth_Controller
/**
* Updates a new Notiz for a person
* @param int $notiz_id
* @param int $person_id
*/
public function updateNotiz($notiz_id)
{
@@ -1226,13 +1225,22 @@ class InfoCenter extends Auth_Controller
if (isset($zgvpruefung->prestudentstatus))
{
//get orgform for german and english
if (isset($zgvpruefung->prestudentstatus->bezeichnung_orgform) && is_array($zgvpruefung->prestudentstatus->bezeichnung_orgform))
{
$zgvpruefung->prestudentstatus->bezeichnung_orgform_german = getPhraseByLanguage($zgvpruefung->prestudentstatus->bezeichnung_orgform, 'German');
$zgvpruefung->prestudentstatus->bezeichnung_orgform_english = getPhraseByLanguage($zgvpruefung->prestudentstatus->bezeichnung_orgform, 'English');
}
$position = strpos($zgvpruefung->prestudentstatus->anmerkung, 'Alt:');
//parse Anmerkung for Alternative (Prio is given in orgform and sprache anyway)
$zgvpruefung->prestudentstatus->alternative = is_numeric($position) ? substr($zgvpruefung->prestudentstatus->anmerkung, $position) : null;
}
//if prestudent is not interessent or is already bestaetigt, then show only as information, non-editable
$zgvpruefung->infoonly = !isset($zgvpruefung->prestudentstatus) || isset($zgvpruefung->prestudentstatus->bestaetigtam) || $zgvpruefung->prestudentstatus->status_kurzbz != 'Interessent';
$zgvpruefung->infoonly = !isset($zgvpruefung->prestudentstatus)
|| isset($zgvpruefung->prestudentstatus->bestaetigtam)
|| $zgvpruefung->prestudentstatus->status_kurzbz != self::INTERESSENTSTATUS;
//wether prestudent was freigegeben for RT/Stg
$zgvpruefung->isRtFreigegeben = false;
@@ -1241,7 +1249,7 @@ class InfoCenter extends Auth_Controller
$this->PrestudentstatusModel->addSelect('bestaetigtam, statusgrund_id, tbl_status_grund.bezeichnung_mehrsprachig AS bezeichnung_statusgrund');
$this->PrestudentstatusModel->addJoin('public.tbl_status_grund', 'statusgrund_id', 'LEFT');
$isFreigegeben = $this->PrestudentstatusModel->loadWhere(array('studiensemester_kurzbz' => $zgvpruefung->prestudentstatus->studiensemester_kurzbz,
'tbl_prestudentstatus.status_kurzbz' => 'Interessent', 'prestudent_id' => $prestudent->prestudent_id));
'tbl_prestudentstatus.status_kurzbz' => self::INTERESSENTSTATUS, 'prestudent_id' => $prestudent->prestudent_id));
if (hasData($isFreigegeben))
@@ -1270,7 +1278,7 @@ class InfoCenter extends Auth_Controller
$zgvpruefung->changeup = false;
$zgvpruefung->changedown = false;
if (isset($zgvpruefung->prestudentstatus->status_kurzbz) && $zgvpruefung->prestudentstatus->status_kurzbz == 'Interessent')
if (isset($zgvpruefung->prestudentstatus->status_kurzbz) && $zgvpruefung->prestudentstatus->status_kurzbz == self::INTERESSENTSTATUS)
{
if (isset($zgvpruefung->prestudentstatus->studiensemester_kurzbz))
{
@@ -1285,8 +1293,8 @@ class InfoCenter extends Auth_Controller
$this->_sortPrestudents($zgvpruefungen);
$abwstatusgruende = $this->StatusgrundModel->loadWhere(array('status_kurzbz' => 'Abgewiesener'))->retval;
$intstatusgruende = $this->StatusgrundModel->loadWhere(array('status_kurzbz' => 'Interessent'))->retval;
$abwstatusgruende = $this->StatusgrundModel->loadWhere(array('status_kurzbz' => self::ABGEWIESENERSTATUS))->retval;
$intstatusgruende = $this->StatusgrundModel->loadWhere(array('status_kurzbz' => self::INTERESSENTSTATUS))->retval;
$data = array (
'zgvpruefungen' => $zgvpruefungen,
@@ -1344,9 +1352,9 @@ class InfoCenter extends Auth_Controller
return 1;
elseif ($a->prestudentstatus->status_kurzbz !== $b->prestudentstatus->status_kurzbz)
{
if ($a->prestudentstatus->status_kurzbz === 'Interessent')
if ($a->prestudentstatus->status_kurzbz === self::INTERESSENTSTATUS)
return -1;
elseif ($b->prestudentstatus->status_kurzbz === 'Interessent')
elseif ($b->prestudentstatus->status_kurzbz === self::INTERESSENTSTATUS)
return 1;
}
}
+1 -1
View File
@@ -218,7 +218,7 @@ class Prestudent_model extends DB_Model
if (count($lastStatus->retval) > 0)
{
// get Studiengangname from Studienlan and -ordnung
//get Studiengangname from Studienplan and -ordnung
$studienordnung = $this->PrestudentstatusModel->getStudienordnungFromPrestudent($prestudent_id);
if ($studienordnung->error)
return error($studienordnung->retval);
@@ -19,14 +19,17 @@ class Prestudentstatus_model extends DB_Model
public function getLastStatus($prestudent_id, $studiensemester_kurzbz = '', $status_kurzbz = '')
{
$query = 'SELECT tbl_prestudentstatus.*,
bezeichnung AS studienplan_bezeichnung,
tbl_studienplan.orgform_kurzbz as orgform,
tbl_studienplan.bezeichnung AS studienplan_bezeichnung,
tbl_studienplan.orgform_kurzbz AS orgform,
sprache,
tbl_orgform.bezeichnung_mehrsprachig AS bezeichnung_orgform,
tbl_status.bezeichnung_mehrsprachig,
tbl_status_grund.bezeichnung_mehrsprachig as bezeichnung_statusgrund
FROM public.tbl_prestudentstatus LEFT JOIN lehre.tbl_studienplan USING (studienplan_id)
tbl_status_grund.bezeichnung_mehrsprachig AS bezeichnung_statusgrund
FROM public.tbl_prestudentstatus
LEFT JOIN lehre.tbl_studienplan USING (studienplan_id)
JOIN public.tbl_status USING (status_kurzbz)
LEFT JOIN public.tbl_status_grund USING (statusgrund_id)
LEFT JOIN bis.tbl_orgform ON tbl_studienplan.orgform_kurzbz = bis.tbl_orgform.orgform_kurzbz
WHERE tbl_status.status_kurzbz = tbl_prestudentstatus.status_kurzbz
AND prestudent_id = ?';