mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-02 04:39:28 +00:00
check if not abgewiesen or bestätigt before abweisen or bestätigen, removed Zustellung column, retrieve only zugestellte kontakte, log entrys starting uppercase
This commit is contained in:
@@ -19,8 +19,8 @@ class InfoCenter extends VileSci_Controller
|
||||
private $logparams = array(
|
||||
'saveformalgep' => array(
|
||||
'logtype' => 'Action',
|
||||
'name' => 'document formally checked',
|
||||
'message' => 'document %s formally checked, set to %s'
|
||||
'name' => 'Document formally checked',
|
||||
'message' => 'Document %s formally checked, set to %s'
|
||||
),
|
||||
'savezgv' => array(
|
||||
'logtype' => 'Action',
|
||||
@@ -35,12 +35,12 @@ class InfoCenter extends VileSci_Controller
|
||||
'freigegeben' => array(
|
||||
'logtype' => 'Processstate',
|
||||
'name' => 'Interessent confirmed',
|
||||
'message' => 'status Interessent for prestudentid %s was confirmed for degree program %s'
|
||||
'message' => 'Status Interessent for prestudentid %s was confirmed for degree program %s'
|
||||
),
|
||||
'savenotiz' => array(
|
||||
'logtype' => 'Action',
|
||||
'name' => 'note added',
|
||||
'message' => 'note with title %s was added'
|
||||
'name' => 'Note added',
|
||||
'message' => 'Note with title %s was added'
|
||||
)
|
||||
);
|
||||
private $uid; // contains the UID of the logged user
|
||||
@@ -232,40 +232,43 @@ class InfoCenter extends VileSci_Controller
|
||||
show_error($lastStatus->retval);
|
||||
}
|
||||
|
||||
$result = $this->PrestudentstatusModel->insert(
|
||||
array(
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'studiensemester_kurzbz' => $lastStatus->retval[0]->studiensemester_kurzbz,
|
||||
'ausbildungssemester' => $lastStatus->retval[0]->ausbildungssemester,
|
||||
'datum' => date('Y-m-d'),
|
||||
'orgform_kurzbz' => $lastStatus->retval[0]->orgform_kurzbz,
|
||||
'studienplan_id' => $lastStatus->retval[0]->studienplan_id,
|
||||
'status_kurzbz' => 'Abgewiesener',
|
||||
'statusgrund_id' => $statusgrund,
|
||||
'insertvon' => $this->uid,
|
||||
'insertamum' => date('Y-m-d H:i:s')
|
||||
)
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
//check if still Interessent and not freigegeben yet
|
||||
if($lastStatus->retval[0]->status_kurzbz === 'Interessent' && !isset($lastStatus->retval[0]->bestaetigtam))
|
||||
{
|
||||
show_error($result->retval);
|
||||
$result = $this->PrestudentstatusModel->insert(
|
||||
array(
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'studiensemester_kurzbz' => $lastStatus->retval[0]->studiensemester_kurzbz,
|
||||
'ausbildungssemester' => $lastStatus->retval[0]->ausbildungssemester,
|
||||
'datum' => date('Y-m-d'),
|
||||
'orgform_kurzbz' => $lastStatus->retval[0]->orgform_kurzbz,
|
||||
'studienplan_id' => $lastStatus->retval[0]->studienplan_id,
|
||||
'status_kurzbz' => 'Abgewiesener',
|
||||
'statusgrund_id' => $statusgrund,
|
||||
'insertvon' => $this->uid,
|
||||
'insertamum' => date('Y-m-d H:i:s')
|
||||
)
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
show_error($result->retval);
|
||||
}
|
||||
|
||||
$logdata = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id);
|
||||
|
||||
//statusgrund bezeichnung for logging
|
||||
$this->StatusgrundModel->addSelect('bezeichnung_mehrsprachig');
|
||||
$result = $this->StatusgrundModel->load($statusgrund);
|
||||
if (isError($result))
|
||||
{
|
||||
show_error($result->retval);
|
||||
}
|
||||
|
||||
$statusgrund_bez = $result->retval[0]->bezeichnung_mehrsprachig[1];
|
||||
|
||||
$this->_log($logdata['person_id'], 'abgewiesen', array($prestudent_id, $logdata['studiengang_kurzbz'], $statusgrund_bez));
|
||||
}
|
||||
|
||||
$logdata = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id);
|
||||
|
||||
//statusgrund bezeichnung for logging
|
||||
$this->StatusgrundModel->addSelect('bezeichnung_mehrsprachig');
|
||||
$result = $this->StatusgrundModel->load($statusgrund);
|
||||
if (isError($result))
|
||||
{
|
||||
show_error($result->retval);
|
||||
}
|
||||
|
||||
$statusgrund_bez = $result->retval[0]->bezeichnung_mehrsprachig[1];
|
||||
|
||||
$this->_log($logdata['person_id'], 'abgewiesen', array($prestudent_id, $logdata['studiengang_kurzbz'], $statusgrund_bez));
|
||||
|
||||
$this->_redirectToStart($prestudent_id, 'ZgvPruef');
|
||||
}
|
||||
|
||||
@@ -282,31 +285,35 @@ class InfoCenter extends VileSci_Controller
|
||||
{
|
||||
$lastStatus = $lastStatus->retval[0];
|
||||
|
||||
$result = $this->PrestudentstatusModel->update(
|
||||
array(
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'status_kurzbz' => $lastStatus->status_kurzbz,
|
||||
'studiensemester_kurzbz' => $lastStatus->studiensemester_kurzbz,
|
||||
'ausbildungssemester' => $lastStatus->ausbildungssemester
|
||||
),
|
||||
array(
|
||||
'bestaetigtvon' => $this->uid,
|
||||
'bestaetigtam' => date('Y-m-d'),
|
||||
'updatevon' => $this->uid,
|
||||
'updateamum' => date('Y-m-d H:i:s')
|
||||
)
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
//check if still Interessent and not freigegeben yet
|
||||
if($lastStatus->status_kurzbz === 'Interessent' && !isset($lastStatus->bestaetigtam))
|
||||
{
|
||||
show_error($result->retval);
|
||||
$result = $this->PrestudentstatusModel->update(
|
||||
array(
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'status_kurzbz' => $lastStatus->status_kurzbz,
|
||||
'studiensemester_kurzbz' => $lastStatus->studiensemester_kurzbz,
|
||||
'ausbildungssemester' => $lastStatus->ausbildungssemester
|
||||
),
|
||||
array(
|
||||
'bestaetigtvon' => $this->uid,
|
||||
'bestaetigtam' => date('Y-m-d'),
|
||||
'updatevon' => $this->uid,
|
||||
'updateamum' => date('Y-m-d H:i:s')
|
||||
)
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
show_error($result->retval);
|
||||
}
|
||||
|
||||
$logdata = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id);
|
||||
|
||||
$this->_log($logdata['person_id'], 'freigegeben', array($prestudent_id, $logdata['studiengang_kurzbz']));
|
||||
}
|
||||
}
|
||||
|
||||
$logdata = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id);
|
||||
|
||||
$this->_log($logdata['person_id'], 'freigegeben', array($prestudent_id, $logdata['studiengang_kurzbz']));
|
||||
|
||||
$this->_redirectToStart($prestudent_id, 'ZgvPruef');
|
||||
}
|
||||
|
||||
@@ -453,7 +460,7 @@ class InfoCenter extends VileSci_Controller
|
||||
*/
|
||||
private function _loadPersonData($person_id)
|
||||
{
|
||||
$stammdaten = $this->PersonModel->getPersonStammdaten($person_id);
|
||||
$stammdaten = $this->PersonModel->getPersonStammdaten($person_id, true);
|
||||
|
||||
if (isError($stammdaten))
|
||||
{
|
||||
|
||||
@@ -157,9 +157,10 @@ class Person_model extends DB_Model
|
||||
* gets Stammdaten for a person, including contactdata in textform from other tables
|
||||
* nation, kontakt, adresse
|
||||
* @param $person_id
|
||||
* @param bool $zustellung_only, when true, retrieve only Zustellkontakte
|
||||
* @return array, null when no person found
|
||||
*/
|
||||
public function getPersonStammdaten($person_id)
|
||||
public function getPersonStammdaten($person_id, $zustellung_only = false)
|
||||
{
|
||||
$this->addSelect('public.tbl_person.*, s.kurztext as staatsbuergerschaft, g.kurztext as geburtsnation');
|
||||
$this->addJoin('bis.tbl_nation s', 'public.tbl_person.staatsbuergerschaft = s.nation_code', 'LEFT');
|
||||
@@ -180,11 +181,12 @@ class Person_model extends DB_Model
|
||||
$this->KontaktModel->addDistinct();
|
||||
$this->KontaktModel->addSelect('kontakttyp, anmerkung, kontakt, zustellung');
|
||||
$this->KontaktModel->addOrder('kontakttyp');
|
||||
$kontakte = $this->KontaktModel->loadWhere(array('person_id' => $person_id));
|
||||
$where = $zustellung_only === true ? array('person_id' => $person_id, 'zustellung' => true) : array('person_id' => $person_id);
|
||||
$kontakte = $this->KontaktModel->loadWhere($where);
|
||||
if($kontakte->error)
|
||||
return error($kontakte->retval);
|
||||
|
||||
$adressen = $this->AdresseModel->loadWhere(array('person_id' => $person_id));
|
||||
$where = $zustellung_only === true ? array('person_id' => $person_id, 'zustelladresse' => true) : array('person_id' => $person_id);
|
||||
$adressen = $this->AdresseModel->loadWhere($where);
|
||||
if($adressen->error)
|
||||
return error($adressen->retval);
|
||||
|
||||
|
||||
@@ -91,7 +91,6 @@ $this->load->view(
|
||||
<tr>
|
||||
<th class="text-center">Typ</th>
|
||||
<th class="text-center">Kontakt</th>
|
||||
<th class="text-center">Zustellung</th>
|
||||
<th class="text-center">Anmerkung</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -111,7 +110,6 @@ $this->load->view(
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-center"><?php echo $kontakt->zustellung === true ? '<span class="glyphicon glyphicon-ok"></span>' : ''; ?></td>
|
||||
<td><?php echo $kontakt->anmerkung; ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
@@ -123,9 +121,6 @@ $this->load->view(
|
||||
<td>
|
||||
<?php echo isset($adresse) ? $adresse->strasse.', '.$adresse->plz.' '.$adresse->ort : '' ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php echo $adresse->zustelladresse === true ? '<span class="glyphicon glyphicon-ok"></span>' : '' ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo ($adresse->heimatadresse === true ? 'Heimatadresse' : '').($adresse->heimatadresse === true && $adresse->rechnungsadresse === true ? ', ' : '').($adresse->rechnungsadresse === true ? 'Rechnungsadresse' : ''); ?>
|
||||
</td>
|
||||
@@ -148,7 +143,7 @@ $this->load->view(
|
||||
<a
|
||||
href="<?php echo base_url('addons/bewerbung/cis/registration.php?code='.html_escape($stammdaten->zugangscode)) ?>"
|
||||
target='_blank'><i
|
||||
class="glyphicon glyphicon-new-window"></i> Zugang
|
||||
class="glyphicon glyphicon-new-window"></i> Zugang
|
||||
Bewerbung</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -128,7 +128,7 @@ if(isset($radio_1) && isset($radio_2) && $radio_1>=0 && $radio_2>=0)
|
||||
$msg .= "<br>".mb_eregi_replace(';',';<br>',$sql_query_upd1);
|
||||
$db->db_query("COMMIT;");
|
||||
//Logeintrag schreiben
|
||||
PersonLog($radio_2, 'Action', array('name' => 'Persons merged', 'message' => 'person with id '.$radio_1.' merged into person with id '.$radio_2, 'success' => 'true'), 'datenwartung', 'core', null, $uid);
|
||||
PersonLog($radio_2, 'Action', array('name' => 'Persons merged', 'message' => 'Person with id '.$radio_1.' merged into person with id '.$radio_2, 'success' => 'true'), 'datenwartung', 'core', null, $uid);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user