Merge branch 'feature-27949/infocenter_evaluieren_des_zurueckstellens_mit_einem_grund_zb_fuer_drittstaaten'

This commit is contained in:
Andreas Österreicher
2023-05-05 07:48:53 +02:00
16 changed files with 633 additions and 599 deletions
@@ -142,12 +142,6 @@ class InfoCenter extends Auth_Controller
'reloadNotizen' => array('infocenter:r', 'lehre/zgvpruefung:r'),
'reloadLogs' => 'infocenter:r',
'outputAkteContent' => array('infocenter:r', 'lehre/zgvpruefung:r'),
'getPostponeDate' => array('infocenter:r', 'lehre/zgvpruefung:r'),
'park' => 'infocenter:rw',
'unpark' => 'infocenter:rw',
'setOnHold' => 'infocenter:rw',
'removeOnHold' => array('infocenter:rw', 'lehre/zgvpruefung:rw'),
'getStudienjahrEnd' => array('infocenter:r', 'lehre/zgvpruefung:r'),
'setNavigationMenuArrayJson' => 'infocenter:r',
'getAbsageData' => 'infocenter:r',
'saveAbsageForAll' => 'infocenter:rw',
@@ -164,6 +158,7 @@ class InfoCenter extends Auth_Controller
$this->load->model('crm/Statusgrund_model', 'StatusgrundModel');
$this->load->model('crm/ZGVPruefung_model', 'ZGVPruefungModel');
$this->load->model('crm/ZGVPruefungStatus_model', 'ZGVPruefungStatusModel');
$this->load->model('crm/Rueckstellung_model', 'RueckstellungModel');
$this->load->model('person/Notiz_model', 'NotizModel');
$this->load->model('person/Person_model', 'PersonModel');
$this->load->model('system/Message_model', 'MessageModel');
@@ -606,7 +601,7 @@ class InfoCenter extends Auth_Controller
}
/**
* Sendet bei einer neuen ZGV Prüfung die Mail raus an den Studiengang
* Sendet bei einer neuen ZGV Prüfung eine Mail an den Studiengang
*/
private function sendZgvMail($mail, $typ, $person){
$data = array(
@@ -697,7 +692,7 @@ class InfoCenter extends Auth_Controller
/**
* Fügt einen neuen ZGV Status hinzu oder updated einen bestehenden
* Falls es erfolgreich war, sendet er die Mail raus
* Falls es erfolgreich war, wird eine Mail rausgeschickt
*/
public function zgvRueckfragen()
{
@@ -751,7 +746,8 @@ class InfoCenter extends Auth_Controller
$this->sendZgvMail($mail, $typ, $person);
elseif (isError($insert))
$this->terminateWithJsonError('Fehler beim Speichern');
}else
}
else
{
$insert = $this->ZGVPruefungModel->insert(
array(
@@ -781,7 +777,7 @@ class InfoCenter extends Auth_Controller
}
$hold = false;
if ($this->personloglib->getOnHoldDate($person_id) !== null)
if (hasData($this->RueckstellungModel->getByPersonId($person_id, 'onhold_zgv')))
$hold = true;
$this->outputJsonSuccess(
@@ -1162,107 +1158,7 @@ class InfoCenter extends Auth_Controller
->set_output($aktecontent->retval)
->_display();
}
/**
* Gets the date until which a person is parked
* @param $person_id
*/
public function getPostponeDate($person_id)
{
$result = array(
'type' => null,
'date' => null
);
$parkedDate = $this->personloglib->getParkedDate($person_id);
if (isset($parkedDate))
{
$result['type'] = 'parked';
$result['date'] = $parkedDate;
}
else
{
$onholdDate = $this->personloglib->getOnHoldDate($person_id);
if (isset($onholdDate))
{
$result['type'] = 'onhold';
$result['date'] = $onholdDate;
}
}
$this->outputJsonSuccess($result);
}
/**
* Initializes parking of a person, i.e. a person is not expected to do any actions while parked
*/
public function park()
{
$person_id = $this->input->post('person_id');
$date = $this->input->post('parkdate');
$result = $this->personloglib->park($person_id, date_format(date_create($date), 'Y-m-d'), self::TAETIGKEIT, self::APP, null, $this->_uid);
$this->outputJson($result);
}
/**
* Removes parking of a person
*/
public function unPark()
{
$person_id = $this->input->post('person_id');
$result = $this->personloglib->unPark($person_id);
$this->outputJson($result);
}
/**
* Sets a person on hold ("zurückstellen")
*/
public function setOnHold()
{
$person_id = $this->input->post('person_id');
$date = $this->input->post('onholddate');
$result = $this->personloglib->setOnHold($person_id, date_format(date_create($date), 'Y-m-d'), self::TAETIGKEIT, self::APP, null, $this->_uid);
$this->outputJson($result);
}
/**
* Removed on hold status of a person
*/
public function removeOnHold()
{
$person_id = $this->input->post('person_id');
$result = $this->personloglib->removeOnHold($person_id);
$this->outputJson($result);
}
/**
* Gets the End date of the current Studienjahr
*/
public function getStudienjahrEnd()
{
$this->load->model('organisation/studienjahr_model', 'StudienjahrModel');
$result = $this->StudienjahrModel->getCurrStudienjahr();
$json = null;
if (hasData($result))
{
$json = $result->retval[0]->ende;
}
$this->outputJsonSuccess(array($json));
}
/**
* Wrapper for setNavigationMenu, returns JSON message
@@ -1484,7 +1380,6 @@ class InfoCenter extends Auth_Controller
if($nachreichungAm < $today)
$this->terminateWithJsonError($this->p->t('infocenter', 'nachreichDatumNichtVergangenheit'));
$akte = $this->AkteModel->loadWhere(array('person_id' => $person_id, 'dokument_kurzbz' => $allowedTypes[$typ]));
if (hasData($akte)) {
@@ -0,0 +1,135 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
class Rueckstellung extends Auth_Controller
{
private $_ci; // Code igniter instance
private $_uid;
public function __construct()
{
parent::__construct(
array(
'get' => array('infocenter:r', 'lehre/zgvpruefung:r'),
'set' => array('infocenter:r', 'lehre/zgvpruefung:r'),
'delete' => array('infocenter:r', 'lehre/zgvpruefung:r'),
'getStatus' => array('infocenter:rw', 'lehre/zgvpruefung:rw')
)
);
$this->load->model('crm/Rueckstellung_model', 'RueckstellungModel');
$this->load->model('crm/RueckstellungStatus_model', 'RueckstellungStatusModel');
$this->load->model('person/Person_model', 'PersonModel');
$this->load->library('PersonLogLib');
$this->_setAuthUID(); // sets property uid
$this->_ci =& get_instance(); // get code igniter instance
}
public function get($person_id)
{
$result = null;
$rueckstellung = $this->_ci->RueckstellungModel->getByPersonId($person_id);
if (isError($rueckstellung))
$this->terminateWithJsonError($this->_ci->p->t('ui', 'fehlerBeimLesen'));
if (hasData($rueckstellung))
{
$rueckstellung = getData($rueckstellung)[0];
$fullName = getData($this->_ci->PersonModel->getFullName($rueckstellung->insertvon));
$result = array(
'von' => $fullName,
'bezeichnung' => $rueckstellung->bezeichnung,
'bis' => $rueckstellung->datum_bis,
'status_kurzbz' => $rueckstellung->status_kurzbz
);
if ($rueckstellung->status_kurzbz === 'parked' && $rueckstellung->datum_bis < date('Y-m-d'))
{
$this->_ci->RueckstellungModel->delete(array('person_id' => $person_id, 'status_kurzbz' => 'parked'));
$result = null;
}
}
$this->outputJsonSuccess($result);
}
public function set()
{
$person_id = $this->input->post('person_id');
$datum_bis = $this->input->post('datum_bis');
$status_kurzbz = $this->input->post('status_kurzbz');
$result = $this->_ci->RueckstellungModel->insert(
array('person_id' => $person_id,
'status_kurzbz' => $status_kurzbz,
'datum_bis' => date_format(date_create($datum_bis), 'Y-m-d'),
'insertvon' => $this->_uid
)
);
if (isError($result))
$this->terminateWithJsonError(getError($result));
$this->_log($person_id, $status_kurzbz);
$this->outputJson($result);
}
public function delete()
{
$person_id = $this->input->post('person_id');
$status = $this->input->post('status');
$result = $this->_ci->RueckstellungModel->delete(array('person_id' => $person_id, 'status_kurzbz' => $status));
if (isError($result))
$this->terminateWithJsonError($this->_ci->p->t('ui', 'fehlerBeimSpeichern'));
$this->outputJson($result);
}
public function getStatus($aktiv = true)
{
$this->_ci->RueckstellungStatusModel->addOrder('sort');
$result = $this->_ci->RueckstellungStatusModel->loadWhere(array('aktiv' => $aktiv));
if (isError($result))
$this->terminateWithJsonError($this->_ci->p->t('ui', 'fehlerBeimLesen'));
$this->outputJsonSuccess(getData($result));
}
/**
* 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');
}
private function _log($person_id, $status_kurzbz)
{
$message = "Person $person_id set to $status_kurzbz";
$this->_ci->personloglib->log(
$person_id,
'Action',
array(
'name' => 'Person status set',
'message' => $message,
'success' => true
),
'bewerbung',
'infocenter',
null,
$this->_uid
);
}
}
-165
View File
@@ -7,9 +7,6 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
*/
class PersonLogLib
{
const PARKED_LOGNAME = 'Parked';
const ONHOLD_LOGNAME = 'Onhold';
/**
* Constructor
*/
@@ -78,168 +75,6 @@ class PersonLogLib
else
show_error(getError($result));
}
/**
* Parks a person, i.e. marks a person so no actions are expected for the person (e.g. as a prestudent)
* Done by adding a logentry in the future
* @param $person_id
* @param $date
* @param $taetigkeit_kurzbz
* @param string $app
* @param null $oe_kurzbz
* @param null $user
* @return insert object
*/
public function park($person_id, $date, $taetigkeit_kurzbz, $app = 'core', $oe_kurzbz = null, $user = null)
{
$onhold = $this->getOnHoldDate($person_id);
if (hasData($onhold))
return error("Person already on hold");
$logjson = array(
'name' => self::PARKED_LOGNAME
);
return $this->_savePsLog($person_id, $date, $taetigkeit_kurzbz, $logjson, $app, $oe_kurzbz, $user);
}
/**
* Unparks a person, i.e. removes all log entries in the future with logname for parking
* @param $person_id
* @return array with deleted logids
*/
public function unPark($person_id)
{
$deleted = array();
$result = $this->ci->PersonLogModel->getLogsInFuture($person_id);
if (hasData($result))
{
foreach ($result->retval as $log)
{
$logdata = json_decode($log->logdata);
if (isset($logdata->name) && $logdata->name === self::PARKED_LOGNAME)
{
$delresult = $this->ci->PersonLogModel->deleteLog($log->log_id);
if (isSuccess($delresult))
{
$deleted[] = $log->log_id;
}
}
}
}
return success($deleted);
}
/**
* Gets date until which a person is parked
* @param $person_id
* @return the date if person is parked, null otherwise
*/
public function getParkedDate($person_id)
{
$result = $this->ci->PersonLogModel->getLogsInFuture($person_id);
$parkeddate = null;
if (hasData($result))
{
foreach ($result->retval as $log)
{
$logdata = json_decode($log->logdata);
if (isset($logdata->name) && $logdata->name === self::PARKED_LOGNAME)
{
$parkeddate = $log->zeitpunkt;
break;
}
}
}
return $parkeddate;
}
/**
* Sets person on hold, i.e. marks a person so no actions are expected for the person (e.g. as a prestudent).
* Done by adding a logentry with a special name. can be undone only manually by clicking button.
* @param $person_id
* @param $date
* @param $taetigkeit_kurzbz
* @param string $app
* @param null $oe_kurzbz
* @param null $user
* @return array
*/
public function setOnHold($person_id, $date, $taetigkeit_kurzbz, $app = 'core', $oe_kurzbz = null, $user = null)
{
$parked = $this->getParkedDate($person_id);
if (hasData($parked))
return error("Person already parked");
$logjson = array(
'name' => self::ONHOLD_LOGNAME
);
return $this->_savePsLog($person_id, $date, $taetigkeit_kurzbz, $logjson, $app, $oe_kurzbz, $user);
}
/**
* Removes on hold status, i.e. removes all log entries with logname for on hold
* @param $person_id
* @return array
*/
public function removeOnHold($person_id)
{
$deleted = array();
$result = $this->ci->PersonLogModel->filterLog($person_id);
if (hasData($result))
{
foreach ($result->retval as $log)
{
$logdata = json_decode($log->logdata);
if (isset($logdata->name) && $logdata->name === self::ONHOLD_LOGNAME)
{
$delresult = $this->ci->PersonLogModel->deleteLog($log->log_id);
if (isSuccess($delresult))
{
$deleted[] = $log->log_id;
}
}
}
}
return success($deleted);
}
/**
* Gets date until which a person is on hold
* @param $person_id
* @return the date if person is on hold, null otherwise
*/
public function getOnHoldDate($person_id)
{
$result = $this->ci->PersonLogModel->filterLog($person_id);
$onholddate = null;
if (hasData($result))
{
foreach ($result->retval as $log)
{
$logdata = json_decode($log->logdata);
if (isset($logdata->name) && $logdata->name === self::ONHOLD_LOGNAME)
{
$onholddate = $log->zeitpunkt;
break;
}
}
}
return $onholddate;
}
/**
* Saves a processstate log with specified parameters, including a specified log date.
* @param $person_id
@@ -0,0 +1,14 @@
<?php
class RueckstellungStatus_model extends DB_Model
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->dbTable = 'public.tbl_rueckstellung_status';
$this->pk = 'status_kurzbz';
}
}
@@ -0,0 +1,33 @@
<?php
class Rueckstellung_model extends DB_Model
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->dbTable = 'public.tbl_rueckstellung';
$this->pk = 'rueckstellung_id';
$this->hasSequence = true;
}
public function getByPersonId($person_id, $status = null)
{
$language_index = getUserLanguage() == 'German' ? 0 : 1;
$this->addLimit(1);
$this->addJoin('tbl_rueckstellung_status', 'status_kurzbz');
$this->addSelect('*,
array_to_json(bezeichnung_mehrsprachig::varchar[])->>'.$language_index . 'as bezeichnung');
$this->addOrder('datum_bis', 'DESC');
$where['person_id'] = $person_id;
if (!isEmptyString($status))
$where['status_kurzbz'] = $status;
return $this->loadWhere($where);
}
}
@@ -7,9 +7,7 @@
$STUDIENGANG_TYP = '\''.$this->variablelib->getVar('infocenter_studiensgangtyp').'\'';
$TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\'';
$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\'';
$POSTPONE_STATUS_PARKED = '\'parked\'';
$STATUS_KURZBZ = '\'Wartender\', \'Bewerber\', \'Aufgenommener\', \'Student\'';
$ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz');
$AKTE_TYP = '\'identity\', \'zgv_bakk\'';
@@ -27,8 +25,6 @@
p.staatsbuergerschaft AS "Nation",
pl.zeitpunkt AS "LockDate",
pl.lockuser AS "LockUser",
pd.parkdate AS "ParkDate",
ohd.onholddate AS "OnholdDate",
(
SELECT l.zeitpunkt
FROM system.tbl_log l
@@ -291,7 +287,9 @@
LIMIT 1
)
LIMIT 1
) AS "InfoCenterMitarbeiter"
) AS "InfoCenterMitarbeiter",
rueck.datum_bis AS "HoldDate",
rueck.bezeichnung AS "Rueckstellgrund"
FROM public.tbl_person p
LEFT JOIN (
SELECT tpl.person_id,
@@ -302,22 +300,24 @@
JOIN public.tbl_person sp ON sb.person_id = sp.person_id
WHERE tpl.app = '.$APP.'
) pl USING(person_id)
LEFT JOIN (
SELECT l.person_id,
l.zeitpunkt AS parkdate
FROM system.tbl_log l
WHERE l.logtype_kurzbz = '.$LOGTYPE_KURZBZ.'
AND l.logdata->>\'name\' = '.$LOGDATA_NAME_PARKED.'
AND l.zeitpunkt >= NOW()
) pd USING(person_id)
LEFT JOIN (
SELECT l.person_id,
l.zeitpunkt AS onholddate
FROM system.tbl_log l
WHERE l.logtype_kurzbz = '.$LOGTYPE_KURZBZ.'
AND l.logdata->>\'name\' = '.$LOGDATA_NAME_ONHOLD.'
AND l.zeitpunkt >= NOW()
) ohd USING(person_id)
SELECT
tbl_rueckstellung.person_id,
tbl_rueckstellung.datum_bis,
tbl_rueckstellung.status_kurzbz,
array_to_json(bezeichnung_mehrsprachig::varchar[])->>0 as bezeichnung
FROM public.tbl_rueckstellung
JOIN public.tbl_rueckstellung_status USING(status_kurzbz)
JOIN public.tbl_person sp ON tbl_rueckstellung.person_id = sp.person_id
WHERE tbl_rueckstellung.rueckstellung_id =
(
SELECT srueck.rueckstellung_id
FROM public.tbl_rueckstellung srueck
WHERE srueck.person_id = tbl_rueckstellung.person_id
AND datum_bis >= NOW()
ORDER BY srueck.datum_bis DESC LIMIT 1
)
) rueck ON rueck.person_id = p.person_id
WHERE
EXISTS (
SELECT 1
@@ -344,7 +344,12 @@
AND spss.studiensemester_kurzbz = '.$STUDIENSEMESTER.'
)
)
ORDER BY "LastAction" ASC';
ORDER BY CASE
WHEN rueck.status_kurzbz IS NULL THEN 1
WHEN rueck.status_kurzbz = ' .$POSTPONE_STATUS_PARKED .' THEN 2
WHEN rueck.status_kurzbz != '. $POSTPONE_STATUS_PARKED .' THEN 3
END,
rueck.datum_bis NULLS LAST, "LastAction" ASC';
$filterWidgetArray = array(
'query' => $query,
@@ -366,8 +371,6 @@
ucfirst($this->p->t('person', 'nation')),
ucfirst($this->p->t('global', 'sperrdatum')),
ucfirst($this->p->t('global', 'gesperrtVon')),
ucfirst($this->p->t('global', 'parkdatum')),
ucfirst($this->p->t('global', 'rueckstelldatum')),
ucfirst($this->p->t('global', 'letzteAktion')),
'Aktionstyp',
'AnzahlAktePflicht',
@@ -383,7 +386,9 @@
'ZGV Nation MA',
'ZGV Gruppe BA',
'ZGV Gruppe MA',
'InfoCenter Mitarbeiter'
'InfoCenter Mitarbeiter',
ucfirst($this->p->t('infocenter', 'rueckstelldatum')),
ucfirst($this->p->t('infocenter', 'rueckstellgrund'))
),
'formatRow' => function($datasetRaw) {
@@ -430,18 +435,13 @@
$datasetRaw->{'LockUser'} = '-';
}
if ($datasetRaw->{'ParkDate'} == null)
if ($datasetRaw->{'HoldDate'} == null)
{
$datasetRaw->{'ParkDate'} = '-';
}
if ($datasetRaw->{'OnholdDate'} == null)
{
$datasetRaw->{'OnholdDate'} = '-';
$datasetRaw->{'HoldDate'} = '-';
}
else
{
$datasetRaw->{'OnholdDate'} = date_format(date_create($datasetRaw->{'OnholdDate'}), 'Y-m-d H:i');
$datasetRaw->{'HoldDate'} = date_format(date_create($datasetRaw->{'HoldDate'}), 'Y-m-d H:i');
}
if ($datasetRaw->{'StgAbgeschickt'} == null)
@@ -492,6 +492,11 @@
{
$datasetRaw->{'InfoCenterMitarbeiter'} = 'Ja';
}
if ($datasetRaw->{'Rueckstellgrund'} === null)
{
$datasetRaw->{'Rueckstellgrund'} = '-';
}
return $datasetRaw;
},
@@ -503,17 +508,13 @@
{
$mark = FilterWidget::DEFAULT_MARK_ROW_CLASS;
}
if ($datasetRaw->OnholdDate != null)
{
if ($datasetRaw->Rueckstellgrund != null && $datasetRaw->Rueckstellgrund !== 'Parken')
$mark = "onhold";
}
// Parking has priority over locking
if ($datasetRaw->ParkDate != null)
{
if ($datasetRaw->Rueckstellgrund === 'Parken')
$mark = "text-info";
}
return $mark;
}
@@ -24,42 +24,15 @@
'public/js/tablesort/tablesort.js',
'public/js/infocenter/messageList.js',
'public/js/infocenter/infocenterDetails.js',
'public/js/infocenter/rueckstellung.js',
'public/js/infocenter/zgvUeberpruefung.js',
'public/js/infocenter/docUeberpruefung.js',
'public/js/infocenter/stammdaten.js'
),
'phrases' => array(
'infocenter' => array(
'notizHinzufuegen',
'notizAendern',
'bewerberParken',
'bewerberAusparken',
'nichtsZumAusparken',
'fehlerBeimAusparken',
'fehlerBeimParken',
'bewerberGeparktBis',
'bewerberOnHold',
'bewerberOnHoldEntfernen',
'bewerberOnHoldBis',
'nichtsZumEntfernen',
'fehlerBeimEntfernen',
'rueckstelldatumUeberschritten',
'parkenZurueckstellenInfo',
'zgvInPruefung',
'zgvErfuellt',
'zgvNichtErfuellt',
'zgvErfuelltPruefung',
'datumUngueltig',
'nachreichDatumNichtVergangenheit'
),
'ui' => array(
'gespeichert',
'fehlerBeimSpeichern'
),
'global' => array(
'bis',
'zeilen'
)
'infocenter',
'ui',
'global'
)
);
@@ -26,6 +26,7 @@
'public/js/tablesort/tablesort.js',
'public/js/infocenter/messageList.js',
'public/js/infocenter/infocenterDetails.js',
'public/js/infocenter/rueckstellung.js',
'public/js/infocenter/zgvUeberpruefung.js'
),
'phrases' => array(
+38
View File
@@ -0,0 +1,38 @@
<?php
require_once(dirname(__FILE__).'/basis_db.class.php');
require_once(dirname(__FILE__).'/sprache.class.php');
class rueckstellung extends basis_db
{
public function __construct()
{
parent::__construct();
}
/**
* Löscht alle Einträge mit dem Status "parked" von der übergebenen Person_id, die in der Zukunft liegen.
* @param $person_id
* @return bool
*/
public function deleteParked($person_id)
{
$qry = "DELETE
FROM public.tbl_rueckstellung
WHERE person_id = ".$this->db_add_param($person_id)."
AND status_kurzbz = 'parked'
AND datum_bis >= now();";
if($this->db_query($qry))
{
return true;
}
else
{
$this->errormsg = 'Fehler beim Löschen des geparkten Eintrages';
return false;
}
}
}
?>
+1 -245
View File
@@ -15,15 +15,11 @@ const STGFREIGABE_MESSAGE_VORLAGE_ANDERES_SEMESTER = "InfocenterSTGfreigegebenSe
//Statusgründe for which no Studiengang Freigabe Message should be sent
const FIT_PROGRAMM_STUDIENGAENGE = [10021, 10027];
const PARKEDNAME = 'parked';
const ONHOLDNAME = 'onhold';
/**
* javascript file for infocenterDetails page
*/
$(document).ready(function ()
{
InfocenterDetails._formatMessageTable();
InfocenterDetails._formatNotizTable();
InfocenterDetails._formatLogTable();
@@ -88,7 +84,7 @@ $(document).ready(function ()
);
//check if person is postponed (parked, on hold...) and display it
InfocenterDetails.getPostponeDate(personid);
Rueckstellung.get(personid);
if ($(document).scrollTop() > 20)
$("#scrollToTop").show();
@@ -374,155 +370,6 @@ var InfocenterDetails = {
}
);
},
getStudienjahrEnd: function()
{
FHC_AjaxClient.ajaxCallGet(
CALLED_PATH + "/getStudienjahrEnd",
null,
{
successCallback: function(data, textStatus, jqXHR) {
if (FHC_AjaxClient.hasData(data))
{
var engdate = $.datepicker.parseDate("yy-mm-dd", FHC_AjaxClient.getData(data)[0]);
if (engdate.getDate() === 31)
engdate.setDate(engdate.getDate() - 1);
engdate.setMonth(engdate.getMonth() + 3);
var gerdate = $.datepicker.formatDate("dd.mm.yy", engdate);
$("#postponedate").val(gerdate);
}
},
errorCallback: function()
{
FHC_DialogLib.alertError("error when getting Studienjahr end");
},
veilTimeout: 0
}
);
},
getPostponeDate: function(personid)
{
FHC_AjaxClient.ajaxCallGet(
CALLED_PATH + "/getPostponeDate/"+encodeURIComponent(personid),
null,
{
successCallback: function(data, textStatus, jqXHR) {
if (FHC_AjaxClient.hasData(data))
{
var postponeobj = FHC_AjaxClient.getData(data);
InfocenterDetails._refreshPostpone(postponeobj);
InfocenterDetails._refreshLog();
if (postponeobj === null || postponeobj.type === null)
InfocenterDetails.getStudienjahrEnd();
}
},
errorCallback: function()
{
FHC_DialogLib.alertError("error when getting parked status");
},
veilTimeout: 0
}
);
},
parkPerson: function(personid, date)
{
var parkError = function(){
$("#postponemsg").text(" Fehler beim Parken!");
};
FHC_AjaxClient.ajaxCallPost(
CALLED_PATH + '/park',
{
"person_id": personid,
"parkdate": date
},
{
successCallback: function(data, textStatus, jqXHR) {
if (FHC_AjaxClient.hasData(data))
InfocenterDetails.getPostponeDate(personid);
else
{
parkError();
}
},
errorCallback: parkError,
veilTimeout: 0
}
);
},
unparkPerson: function(personid)
{
FHC_AjaxClient.ajaxCallPost(
CALLED_PATH + '/unpark',
{
"person_id": personid
},
{
successCallback: function(data, textStatus, jqXHR) {
if (FHC_AjaxClient.hasData(data))
{
InfocenterDetails.getPostponeDate(personid);
}
else
$("#unpostponemsg").removeClass().addClass("text-warning").text(FHC_PhrasesLib.t('infocenter', 'nichtsZumAusparken'));
},
errorCallback: function(){
$("#unpostponemsg").removeClass().addClass("text-danger").text(FHC_PhrasesLib.t('infocenter', 'fehlerBeimAusparken'));
},
veilTimeout: 0
}
);
},
setPersonOnHold: function(personid, date)
{
var onHoldError = function(){
$("#postponemsg").text(" Fehler beim Setzen auf On Hold!");
};
FHC_AjaxClient.ajaxCallPost(
CALLED_PATH + '/setOnHold',
{
"person_id": personid,
"onholddate": date
},
{
successCallback: function(data, textStatus, jqXHR) {
if (FHC_AjaxClient.hasData(data))
InfocenterDetails.getPostponeDate(personid);
else
{
onHoldError();
}
},
errorCallback: onHoldError,
veilTimeout: 0
}
);
},
removePersonOnHold: function(personid)
{
FHC_AjaxClient.ajaxCallPost(
CALLED_PATH + '/removeOnHold',
{
"person_id": personid
},
{
successCallback: function(data, textStatus, jqXHR) {
if (FHC_AjaxClient.hasData(data))
{
InfocenterDetails.getPostponeDate(personid);
}
else
$("#unpostponemsg").removeClass().addClass("text-warning").text(FHC_PhrasesLib.t('infocenter', 'nichtsZumEntfernen'));
},
errorCallback: function(){
$("#unpostponemsg").removeClass().addClass("text-danger").text(FHC_PhrasesLib.t('infocenter', 'fehlerBeimEntfernen'));
},
veilTimeout: 0
}
);
},
getPrestudentData: function(personid, callback)
{
FHC_AjaxClient.ajaxCallGet(
@@ -943,97 +790,6 @@ var InfocenterDetails = {
}
);
},
_refreshPostpone: function(postponeobj)
{
var personid = $("#hiddenpersonid").val();
if (postponeobj === null || postponeobj.date === null || postponeobj.type === null)
{
//show both park and on hold buttons if not parked and not on hold
$("#postponing").html(
'<div class="form-group form-inline">'+
'<button class="btn btn-default" id="parklink" type="button""><i class="fa fa-clock-o"></i>&nbsp;' + FHC_PhrasesLib.t('infocenter', 'bewerberParken') + '</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+
'<button class="btn btn-default" id="onholdlink" type="button""><i class="fa fa-anchor"></i>&nbsp;' + FHC_PhrasesLib.t('infocenter', 'bewerberOnHold') + '</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+
'<label id="postponedatelabel">'+FHC_PhrasesLib.t('global', 'bis') + '&nbsp;&nbsp;'+
'<input id="postponedate" type="text" class="form-control" placeholder="Parkdatum">&nbsp;'+
'<i class="fa fa-info-circle" data-toggle="tooltip" title="'+FHC_PhrasesLib.t('infocenter', 'parkenZurueckstellenInfo')+'"></i></label>'+
'<span class="text-danger" id="postponemsg"></span>'+
'</div>');
$("#postponedate").datepicker({
"dateFormat": "dd.mm.yy",
"minDate": 1
});
$("#parklink").click(
function ()
{
var date = $("#postponedate").val();
InfocenterDetails.parkPerson(personid, date);
}
);
$("#onholdlink").click(
function ()
{
var date = $("#postponedate").val();
InfocenterDetails.setPersonOnHold(personid, date);
}
);
}
else
{
//info if parked/on hold and possibility to undo parking/on hold
var postponedate = $.datepicker.parseDate("yy-mm-dd", postponeobj.date);
var gerpostponedate = $.datepicker.formatDate("dd.mm.yy", postponedate);
//var postponehtml = "";
var callbackforundo = null;
var removePhrase = "";
var postponedPhrase = "";
var postponedtext = "";
if (postponeobj.type === PARKEDNAME)
{
removePhrase = 'bewerberAusparken';
postponedtext = FHC_PhrasesLib.t('infocenter', 'bewerberGeparktBis')+'&nbsp;&nbsp;'+gerpostponedate;
callbackforundo = function ()
{
InfocenterDetails.unparkPerson(personid);
}
}
else if (postponeobj.type === ONHOLDNAME)
{
removePhrase = 'bewerberOnHoldEntfernen';
postponedtext = FHC_PhrasesLib.t('infocenter', 'bewerberOnHoldBis')+'&nbsp;&nbsp;'+gerpostponedate;
var currdate = new Date();
if (currdate > postponedate)
postponedtext = "<span class='alert-danger' data-toggle='tooltip' title='"+FHC_PhrasesLib.t('infocenter', 'rueckstelldatumUeberschritten')+"'>"+postponedtext+"</span>";
callbackforundo = function ()
{
InfocenterDetails.removePersonOnHold(personid);
}
}
var postponehtml = postponedtext+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+
'<button class="btn btn-default" id="unpostponelink"><i class="fa fa-sign-out"></i>&nbsp;'+FHC_PhrasesLib.t('infocenter', removePhrase)+'</button>&nbsp;'+
'<span id="unpostponemsg"></span>';
$("#postponing").html(
postponehtml
);
$("#unpostponelink").click(
callbackforundo
);
}
},
_formatMessageTable: function()
{
Tablesort.addTablesorter("msgtable", [[0, 1], [2, 0]], ["zebra", "filter"], 2);
+185
View File
@@ -0,0 +1,185 @@
const CONTROLLER_RUECKSTELLUNG_URL = "system/infocenter/Rueckstellung";
var Rueckstellung = {
get: function(personid)
{
FHC_AjaxClient.ajaxCallGet(
CONTROLLER_RUECKSTELLUNG_URL + "/get/"+encodeURIComponent(personid),
null,
{
successCallback: function(data, textStatus, jqXHR) {
if (FHC_AjaxClient.hasData(data))
{
var rueckstellungobj = FHC_AjaxClient.getData(data);
Rueckstellung._refreshRueckstellung(rueckstellungobj);
}
else
{
Rueckstellung._addRueckstellungButtons();
}
},
errorCallback: function()
{
FHC_DialogLib.alertError("error when getting rueckstellung status");
},
veilTimeout: 0
}
);
},
getStatus: function()
{
FHC_AjaxClient.ajaxCallGet(
CONTROLLER_RUECKSTELLUNG_URL + "/getStatus",
null,
{
successCallback: function(data, textStatus, jqXHR) {
if (FHC_AjaxClient.hasData(data))
{
let status = FHC_AjaxClient.getData(data);
$.each(status, function(key, value)
{
$('#rueckstellungtype').append($("<option/>")
.val(value.status_kurzbz)
.text(value.bezeichnung_mehrsprachig[0])
)
});
}
},
errorCallback: function()
{
FHC_DialogLib.alertError("error when getting rueckstellung status");
},
veilTimeout: 0
}
);
},
set: function(personid, date, type)
{
if (type === null)
return false;
var onRueckstellungError = function(){
$("#rueckstellungmsg").text(" Fehler beim Setzen auf " + type + "!");
};
FHC_AjaxClient.ajaxCallPost(
CONTROLLER_RUECKSTELLUNG_URL + '/set',
{
"person_id": personid,
"datum_bis": date,
"status_kurzbz": type,
},
{
successCallback: function(data, textStatus, jqXHR) {
if (FHC_AjaxClient.hasData(data))
{
Rueckstellung.get(personid);
InfocenterDetails._refreshLog()
}
else
{
onRueckstellungError();
}
},
errorCallback: onRueckstellungError,
veilTimeout: 0
}
);
},
delete: function(personid, status = null)
{
FHC_AjaxClient.ajaxCallPost(
CONTROLLER_RUECKSTELLUNG_URL + '/delete',
{
"person_id": personid,
"status": status
},
{
successCallback: function(data, textStatus, jqXHR) {
if (FHC_AjaxClient.hasData(data))
{
Rueckstellung.get(personid);
}
else
$("#unrueckstellungmsg").removeClass().addClass("text-warning").text(FHC_PhrasesLib.t('infocenter', 'nichtsZumEntfernen'));
},
errorCallback: function(){
$("#unrueckstellungmsg").removeClass().addClass("text-danger").text(FHC_PhrasesLib.t('infocenter', 'fehlerBeimEntfernen'));
},
veilTimeout: 0
}
);
},
_refreshRueckstellung: function(rueckstellungobj)
{
var personid = $("#hiddenpersonid").val();
var rueckstellungdate = $.datepicker.parseDate("yy-mm-dd", rueckstellungobj.bis);
var gerrueckstellungdate = $.datepicker.formatDate("dd.mm.yy", rueckstellungdate);
var removetext = FHC_PhrasesLib.t('infocenter', 'statusZuruecksetzen');
var rueckstellungdtext = FHC_PhrasesLib.t('global', 'status') + ": '" + rueckstellungobj.bezeichnung + "' " + FHC_PhrasesLib.t('global', 'bis') + ": " + gerrueckstellungdate +
" " + FHC_PhrasesLib.t('ui', 'von') + ": " + rueckstellungobj.von;
var currdate = new Date();
if (currdate > rueckstellungdate)
rueckstellungdtext = "<span class='alert-danger' data-toggle='tooltip' title='"+FHC_PhrasesLib.t('infocenter', 'datumuberschritten')+"'>"+rueckstellungdtext+"</span>";
var callbackforundo = function ()
{
Rueckstellung.delete(personid, rueckstellungobj.status_kurzbz);
}
var rueckstellunghtml = rueckstellungdtext+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+
'<button class="btn btn-default" id="unrueckstellunglink"><i class="fa fa-sign-out"></i>&nbsp;' + removetext +'</button>&nbsp;'+
'<span id="unrueckstellungmsg"></span>';
$("#postponing").html(
rueckstellunghtml
);
$("#unrueckstellunglink").click(
callbackforundo
);
},
_addRueckstellungButtons: function()
{
var personid = $("#hiddenpersonid").val();
$("#postponing").html(
'<div class="form-group form-inline">'+
'<div class="form-group">' +
'<select id="rueckstellungtype" class="form-control">' +
'<option disabled selected>' + FHC_PhrasesLib.t('infocenter', 'statusAuswahl') + '</option>' +
'</select>' + '&nbsp;&nbsp;' +
'<button class="btn btn-default" id="addRueckstellung" type="button""><i class="fa fa-clock-o"></i>&nbsp;' + FHC_PhrasesLib.t('infocenter', 'statusSetzen') + '</button>&nbsp;'+
'<label id="rueckstellungdatelabel">'+FHC_PhrasesLib.t('global', 'bis') + '&nbsp;&nbsp;'+
'<input id="rueckstellungdate" type="text" class="form-control" placeholder="Parkdatum">&nbsp;'+
'<i class="fa fa-info-circle" data-toggle="tooltip" title="'+FHC_PhrasesLib.t('infocenter', 'parkenZurueckstellenInfo')+'"></i></label>'+
'<span class="text-danger" id="rueckstellungmsg"></span>'+
'</div>' +
'</div>');
Rueckstellung.getStatus();
var rueckstelldate = new Date();
rueckstelldate.setDate(rueckstelldate.getDate() + 14);
$('#rueckstellungdate').attr("value", $.datepicker.formatDate("dd.mm.yy", rueckstelldate));
$("#rueckstellungdate").datepicker({
"dateFormat": "dd.mm.yy",
"minDate": 1
});
$("#addRueckstellung").click(
function ()
{
var date = $("#rueckstellungdate").val();
var type = $("#rueckstellungtype").val();
Rueckstellung.set(personid, date, type);
}
);
},
}
+2 -2
View File
@@ -140,7 +140,7 @@ var zgvUeberpruefung = {
var datum = new Date();
datum.setDate(datum.getDate() + 14);
var formatedDate = $.datepicker.formatDate("mm/dd/yy", datum);
InfocenterDetails.setPersonOnHold(response.person_id, formatedDate);
Rueckstellung.set(response.person_id, formatedDate, 'onhold_zgv');
}
InfocenterDetails._refreshLog();
@@ -171,7 +171,7 @@ var zgvUeberpruefung = {
var response = FHC_AjaxClient.getData(data)
if (response.openZgv === false)
InfocenterDetails.removePersonOnHold(response.person_id);
Rueckstellung.delete(response.person_id, 'onhold_zgv');
FHC_DialogLib.alertSuccess(response.msg);
} else if (FHC_AjaxClient.isError(data))
+1
View File
@@ -33,6 +33,7 @@ require_once('dbupdate_3.4/24682_reihungstest_zugangscode_fuer_login.php');
require_once('dbupdate_3.4/17512_fehlercode_constraints.php');
require_once('dbupdate_3.4/27388_anrechnungen_zeitfenster_pflegen.php');
require_once('dbupdate_3.4/19154_beurteilungsformulare_pruefungssenat.php');
require_once('dbupdate_3.4/27949_infocenter_zurueckstellen_mit_grund.php');
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
@@ -0,0 +1,85 @@
<?php
if (! defined('DB_NAME')) exit('No direct script access allowed');
// Add table tbl_rueckstellung_status
if(!$result = @$db->db_query("SELECT 1 FROM public.tbl_rueckstellung_status LIMIT 1;"))
{
$qry = "
CREATE TABLE public.tbl_rueckstellung_status
(
status_kurzbz character varying(32),
bezeichnung_mehrsprachig character varying(256)[],
sort integer,
aktiv boolean default true
);
ALTER TABLE public.tbl_rueckstellung_status ADD CONSTRAINT pk_tbl_postpone_status_status_kurzbz PRIMARY KEY (status_kurzbz);
INSERT INTO public.tbl_rueckstellung_status(status_kurzbz, bezeichnung_mehrsprachig, sort) VALUES('parked', '{Parken, Park}', 1);
INSERT INTO public.tbl_rueckstellung_status(status_kurzbz, bezeichnung_mehrsprachig, sort) VALUES('onhold_bmi', '{Bundesministerium, Federal Ministry}', 2);
INSERT INTO public.tbl_rueckstellung_status(status_kurzbz, bezeichnung_mehrsprachig, sort) VALUES('onhold_zgv', '{ZGV Prüfung, ZGV examination}', 3);
INSERT INTO public.tbl_rueckstellung_status(status_kurzbz, bezeichnung_mehrsprachig, sort) VALUES('onhold_drittstaat', '{Drittstaat, Third country}', 4);
INSERT INTO public.tbl_rueckstellung_status(status_kurzbz, bezeichnung_mehrsprachig, sort) VALUES('onhold_remone', '{Reminder 1, Reminder 1}', 5);
INSERT INTO public.tbl_rueckstellung_status(status_kurzbz, bezeichnung_mehrsprachig, sort) VALUES('onhold_remtwo', '{Reminder 2, Reminder 2}', 6);
GRANT SELECT, INSERT, UPDATE, DELETE ON public.tbl_rueckstellung_status TO vilesci;
GRANT SELECT ON public.tbl_rueckstellung_status TO web;
";
if(!$db->db_query($qry))
echo '<strong>public.tbl_rueckstellung_status: '.$db->db_last_error().'</strong><br>';
else
echo ' public.tbl_rueckstellung_status: Tabelle hinzugefuegt<br>';
}
// Add table tbl_rueckstellung
if(!$result = @$db->db_query("SELECT 1 FROM public.tbl_rueckstellung LIMIT 1;"))
{
$qry = "
CREATE TABLE public.tbl_rueckstellung
(
rueckstellung_id integer NOT NULL,
person_id integer NOT NULL,
status_kurzbz character varying(32) NOT NULL,
datum_bis timestamp NOT NULL,
insertamum timestamp without time zone default now(),
insertvon character varying(32)
);
CREATE SEQUENCE public.tbl_rueckstellung_id_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.tbl_rueckstellung ADD CONSTRAINT pk_tbl_rueckstellung PRIMARY KEY (rueckstellung_id);
ALTER TABLE public.tbl_rueckstellung ALTER COLUMN rueckstellung_id SET DEFAULT nextval('tbl_rueckstellung_id_seq');
ALTER TABLE public.tbl_rueckstellung ADD CONSTRAINT fk_rueckstellung_person_id FOREIGN KEY (person_id) REFERENCES public.tbl_person(person_id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE public.tbl_rueckstellung ADD CONSTRAINT fk_rueckstellung_status_kurzbz FOREIGN KEY (status_kurzbz) REFERENCES public.tbl_rueckstellung_status(status_kurzbz) ON UPDATE CASCADE ON DELETE RESTRICT;
GRANT SELECT, UPDATE ON public.tbl_rueckstellung_id_seq TO vilesci;
GRANT SELECT, UPDATE ON public.tbl_rueckstellung_id_seq TO web;
GRANT SELECT, INSERT, UPDATE, DELETE ON public.tbl_rueckstellung TO vilesci;
GRANT SELECT, UPDATE, DELETE ON public.tbl_rueckstellung TO web;
";
if(!$db->db_query($qry))
echo '<strong>public.tbl_rueckstellung: '.$db->db_last_error().'</strong><br>';
else
echo ' public.tbl_rueckstellung: Tabelle hinzugefuegt<br>';
//Übernahme von "zurückgestellten" und "geparkten" Personen
$qry = "
INSERT INTO public.tbl_rueckstellung (person_id, status_kurzbz, datum_bis, insertvon)
SELECT person_id,
CASE WHEN
(lower(l.logdata->>'name') = 'onhold')
THEN 'onhold_remone'
ELSE lower(l.logdata->>'name')
END,
zeitpunkt, insertvon
FROM system.tbl_log l
WHERE (l.logdata->>'name' = 'Onhold' OR l.logdata->>'name' = 'Parked') AND zeitpunkt >= NOW();";
if(!$db->db_query($qry))
echo '<strong>public.tbl_rueckstellung: '.$db->db_last_error().'</strong><br>';
else
echo ' public.tbl_rueckstellung: Bestehene Eintraege uebernommen<br>';
}
+2 -1
View File
@@ -40,7 +40,8 @@ $filters = array(
{"name": "User/Operator"},
{"name": "InfoCenterMitarbeiter"},
{"name": "LockUser"},
{"name": "OnholdDate"}
{"name": "HoldDate"},
{"name": "Rueckstellgrund"}
],
"filters": [
{
+83 -2
View File
@@ -3747,8 +3747,8 @@ $phrases = array(
)
),
array(
'app' => 'core',
'category' => 'global',
'app' => 'infocenter',
'category' => 'infocenter',
'phrase' => 'rueckstelldatum',
'insertvon' => 'system',
'phrases' => array(
@@ -3766,6 +3766,26 @@ $phrases = array(
)
)
),
array(
'app' => 'infocenter',
'category' => 'infocenter',
'phrase' => 'rueckstellgrund',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Rückstellgrund',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'onHold reason',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'infocenter',
'category' => 'infocenter',
@@ -17703,6 +17723,67 @@ array(
)
)
),
array(
'app' => 'infocenter',
'category' => 'infocenter',
'phrase' => 'statusSetzen',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Status setzen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Set state',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'infocenter',
'category' => 'infocenter',
'phrase' => 'statusAuswahl',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Status ausw&auml;hlen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Select status',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'infocenter',
'category' => 'infocenter',
'phrase' => 'statusZuruecksetzen',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Status zur&uuml;cksetzen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Reset status',
'description' => '',
'insertvon' => 'system'
)
)
),
);