From 935b37016673dae276c0f0382a986502259aac8d Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 17 Feb 2021 15:07:09 +0100 Subject: [PATCH 01/18] added filter for bachelor and master --- application/config/infocenter.php | 5 ++ application/controllers/system/Variables.php | 16 +++- application/libraries/VariableLib.php | 12 +++ .../models/system/Variablenname_model.php | 3 +- .../system/infocenter/infocenterData.php | 10 +-- .../infocenter/infocenterFreigegebenData.php | 9 +- .../infocenterReihungstestAbsolviertData.php | 9 +- .../js/infocenter/infocenterPersonDataset.js | 90 +++++++++++++++++-- system/dbupdate_3.3.php | 1 + 9 files changed, 126 insertions(+), 29 deletions(-) create mode 100644 application/config/infocenter.php diff --git a/application/config/infocenter.php b/application/config/infocenter.php new file mode 100644 index 000000000..555c30996 --- /dev/null +++ b/application/config/infocenter.php @@ -0,0 +1,5 @@ + 'basis/variable:rw', 'getVar' => 'basis/variable:rw', - 'changeStudiensemesterVar' => 'basis/variable:rw' + 'changeStudiensemesterVar' => 'basis/variable:rw', + 'changeStudengangsTypVar' => 'basis/variable:rw' ) ); @@ -50,7 +51,9 @@ class Variables extends Auth_Controller public function getVar() { $name = $this->input->get('name'); - $this->outputJson($this->VariableModel->getVariables($this->_uid, array($name))); + $typ = $this->input->get('typ'); + + $this->outputJson($this->VariableModel->getVariables($this->_uid, array($name, $typ))); } /** @@ -66,6 +69,15 @@ class Variables extends Auth_Controller $this->outputJson($result); } + public function changeStudengangsTypVar() + { + $name = $this->input->post('name'); + $change = $this->input->post('change'); + + $result = $this->variablelib->changeStudengangsTypVar($this->_uid, $name, $change); + $this->outputJson($result); + } + /** * Retrieve the UID of the logged user and checks if it is valid */ diff --git a/application/libraries/VariableLib.php b/application/libraries/VariableLib.php index 2f038531b..a503eb999 100644 --- a/application/libraries/VariableLib.php +++ b/application/libraries/VariableLib.php @@ -100,6 +100,18 @@ class VariableLib return $result; } + public function changeStudengangsTypVar($uid, $name, $change) + { + $result = error('error when setting variable!'); + + if (isEmptyString($uid) || isEmptyString($name) || isEmptyString($change)) + return $result; + + $result = $this->_ci->VariableModel->setVariable($uid, $name, $change); + $this->_setVariable($uid, $name); + return $result; + } + /** * "Refreshes" variable value with given name by retrieving current value from db and saving it. * @param $uid diff --git a/application/models/system/Variablenname_model.php b/application/models/system/Variablenname_model.php index 7b2a2cf88..005834f67 100644 --- a/application/models/system/Variablenname_model.php +++ b/application/models/system/Variablenname_model.php @@ -11,7 +11,8 @@ class Variablenname_model extends DB_Model ORDER BY studienjahr_kurzbz, start ) sem WHERE start > now() - LIMIT 1;' + LIMIT 1;', + 'infocenter_studiensgangtyp' => 'SELECT infocenter_studiensgangtyp FROM public.tbl_variablename LIMIT 1' ); /** diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 0c7030059..d9f12eb56 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -1,16 +1,17 @@ config->load('infocenter'); $APP = '\'infocenter\''; $REJECTED_STATUS = '\'Abgewiesener\''; $INTERESSENT_STATUS = '\'Interessent\''; - $STUDIENGANG_TYP = '\'b\''; + $STUDIENGANG_TYP = '\''.$this->variablelib->getVar('infocenter_studiensgangtyp').'\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\', \'Interessent rejected\''; $LOGDATA_NAME_PARKED = '\'Parked\''; $LOGDATA_NAME_ONHOLD = '\'Onhold\''; $LOGTYPE_KURZBZ = '\'Processstate\''; $STATUS_KURZBZ = '\'Wartender\', \'Bewerber\', \'Aufgenommener\', \'Student\''; - $ADDITIONAL_STG = '10021,10027'; + $ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz'); $AKTE_TYP = '\'identity\', \'zgv_bakk\''; $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; @@ -142,10 +143,7 @@ AND pss.bewerbung_abgeschicktamum IS NOT NULL -- AND pss.bestaetigtam IS NULL AND ps.person_id = p.person_id - AND (sg.typ IN ('.$STUDIENGANG_TYP.') - OR - sg.studiengang_kz in('.$ADDITIONAL_STG.') - ) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' AND NOT EXISTS ( SELECT 1 diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index aab69b651..3b7ff1dbe 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -1,12 +1,13 @@ config->load('infocenter'); $APP = '\'infocenter\''; $INTERESSENT_STATUS = '\'Interessent\''; - $STUDIENGANG_TYP = '\'b\''; + $STUDIENGANG_TYP = '\''.$this->variablelib->getVar('infocenter_studiensgangtyp').'\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\''; $REJECTED_STATUS = '\'Abgewiesener\''; - $ADDITIONAL_STG = '10021,10027,10002'; + $ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz'); $STATUS_KURZBZ = '\'Wartender\', \'Bewerber\', \'Aufgenommener\', \'Student\''; $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; @@ -109,10 +110,6 @@ WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND pss.bewerbung_abgeschicktamum IS NOT NULL AND ps.person_id = p.person_id - AND (sg.typ IN ('.$STUDIENGANG_TYP.') - OR - sg.studiengang_kz in('.$ADDITIONAL_STG.') - ) AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' LIMIT 1 ) AS "StgAbgeschickt", diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php index 22b122bb0..6b0918174 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php @@ -1,11 +1,12 @@ config->load('infocenter'); $APP = '\'infocenter\''; $INTERESSENT_STATUS = '\'Interessent\''; - $STUDIENGANG_TYP = '\'b\''; + $STUDIENGANG_TYP = '\''.$this->variablelib->getVar('infocenter_studiensgangtyp').'\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\''; - $ADDITIONAL_STG = '10021,10027'; + $ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz'); $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; $query = ' @@ -90,10 +91,6 @@ WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND pss.bewerbung_abgeschicktamum IS NOT NULL AND ps.person_id = p.person_id - AND (sg.typ IN ('.$STUDIENGANG_TYP.') - OR - sg.studiengang_kz in('.$ADDITIONAL_STG.') - ) AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' LIMIT 1 ) AS "StgAbgeschickt", diff --git a/public/js/infocenter/infocenterPersonDataset.js b/public/js/infocenter/infocenterPersonDataset.js index 87a40c0f1..03d1d13a1 100644 --- a/public/js/infocenter/infocenterPersonDataset.js +++ b/public/js/infocenter/infocenterPersonDataset.js @@ -20,22 +20,30 @@ if (FHC_JS_DATA_STORAGE_OBJECT.called_method == 'index') */ var InfocenterPersonDataset = { infocenter_studiensemester_variablename: 'infocenter_studiensemester', + infocenter_studienganstyp_variablename: 'infocenter_studiensgangtyp', /** * adds person table additional actions html (above and beneath it) */ - appendTableActionsHtml: function(infocenter_studiensemester) + appendTableActionsHtml: function(infocenter_studiensemester, infocenter_studiengangstyp) { var url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/system/messages/Messages/writeTemplate"; var formHtml = '
'; $("#datasetActionsTop").before(formHtml); - var studienSemesterHtml = ' ' + infocenter_studiensemester + - ' '; @@ -56,9 +64,19 @@ var InfocenterPersonDataset = { // userdefined Semestervariable shown independently of personcount, // it is possible to change the semester $("#datasetActionsTop, #datasetActionsBottom").append( - "
"+ - "
"+studienSemesterHtml+"
"+ - "

"); + "
" + + "
" + auswahlStudienart + "
" + + "
" + studienSemesterHtml + "
" + + "
" + + "

" + ); + + InfocenterPersonDataset.selectStudiengangTyp(infocenter_studiengangstyp) + + $('.auswahlStudienArt').change(function() + { + InfocenterPersonDataset.changeStudengangsTyp($(this).find('option:selected').attr('data-id')); + }); $("button.incStudiensemester").click(function() { InfocenterPersonDataset.changeStudiensemesterUservar(1); @@ -115,6 +133,22 @@ var InfocenterPersonDataset = { ); }, + selectStudiengangTyp: function(typ) + { + switch (typ) + { + case 'b, m' : + $('.auswahlStudienArt [data-id="all"]').attr('selected', 'selected'); + break; + case 'b' : + $('.auswahlStudienArt [data-id="bachelor"]').attr('selected', 'selected'); + break; + case 'm' : + $('.auswahlStudienArt [data-id="master"]').attr('selected', 'selected'); + break; + } + }, + /** * sets functionality for the actions above and beneath the person table */ @@ -173,6 +207,45 @@ var InfocenterPersonDataset = { }); }, + changeStudengangsTyp: function($typ) + { + switch ($typ) + { + case 'all' : + var change = 'b\', \'m'; + break; + case 'bachelor' : + var change = 'b'; + break; + case 'master' : + var change = 'm'; + break; + } + + FHC_AjaxClient.showVeil(); + + FHC_AjaxClient.ajaxCallPost( + 'system/Variables/changeStudengangsTypVar', + { + 'name': InfocenterPersonDataset.infocenter_studienganstyp_variablename, + 'change': change, + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.hasData(data)) + { + // refresh filterwidget with page reload + FHC_FilterWidget.reloadDataset(); + } + }, + errorCallback: function(jqXHR, textStatus, errorThrown) { + FHC_AjaxClient.hideVeil(); + alert(textStatus); + } + } + ); + }, + /** * initializes change of the uservariable infocenter_studiensemesster, either * to next semester (change > 0) or previous semester (change < 0) @@ -211,7 +284,8 @@ var InfocenterPersonDataset = { FHC_AjaxClient.ajaxCallGet( 'system/Variables/getVar', { - 'name': InfocenterPersonDataset.infocenter_studiensemester_variablename + 'name' : InfocenterPersonDataset.infocenter_studiensemester_variablename, + 'typ' : InfocenterPersonDataset.infocenter_studienganstyp_variablename }, { successCallback: function(data, textStatus, jqXHR) { @@ -220,7 +294,7 @@ var InfocenterPersonDataset = { if (typeof callback === "function") { var infocenter_studiensemester = FHC_AjaxClient.getData(data); - callback(infocenter_studiensemester[InfocenterPersonDataset.infocenter_studiensemester_variablename]); + callback(infocenter_studiensemester[InfocenterPersonDataset.infocenter_studiensemester_variablename], infocenter_studiensemester[InfocenterPersonDataset.infocenter_studienganstyp_variablename]); } } }, diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 2336ebad4..4ed52c321 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -3232,6 +3232,7 @@ if(!@$db->db_query("SELECT 0 FROM public.tbl_variablenname WHERE 0 = 1")) INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'kontofilterstg\', \'false\'); INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'kollision_student\', \'false\'); INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'infocenter_studiensemester\', null); + INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'infocenter_studiensgangtyp\', \'b\'); INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'ignore_zeitsperre\', \'false\'); INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'ignore_reservierung\', \'false\'); INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'ignore_kollision\', \'false\'); From 287cddf926b4eb6d7442ff06a6ac0b12be3c7fdf Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 23 Mar 2021 09:25:24 +0100 Subject: [PATCH 02/18] added zgv ueberpruefung --- application/config/navigation.php | 9 + .../system/infocenter/InfoCenter.php | 254 +++++++++++++++++- .../system/infocenter/ZGVUeberpruefung.php | 33 +++ .../models/crm/ZGVPruefungStatus_model.php | 17 ++ application/models/crm/ZGVPruefung_model.php | 17 ++ .../views/system/infocenter/dokpruefung.php | 23 +- .../infocenter/infocenterZgvDetails.php | 203 ++++++++++++++ .../infocenter/infocenterZgvUeberpruefung.php | 49 ++++ .../infocenterZgvUeberpruefungData.php | 63 +++++ .../views/system/infocenter/zgvpruefungen.php | 26 +- public/js/infocenter/infocenterDetails.js | 99 +++++++ system/checkroles.php | 2 +- system/checksystem.php | 1 + system/dbupdate_3.3.php | 99 +++++++ system/filtersupdate.php | 8 + system/phrasesupdate.php | 120 +++++++++ 16 files changed, 1010 insertions(+), 13 deletions(-) create mode 100644 application/controllers/system/infocenter/ZGVUeberpruefung.php create mode 100644 application/models/crm/ZGVPruefungStatus_model.php create mode 100644 application/models/crm/ZGVPruefung_model.php create mode 100644 application/views/system/infocenter/infocenterZgvDetails.php create mode 100644 application/views/system/infocenter/infocenterZgvUeberpruefung.php create mode 100644 application/views/system/infocenter/infocenterZgvUeberpruefungData.php diff --git a/application/config/navigation.php b/application/config/navigation.php index 84004b58e..c2d221a80 100644 --- a/application/config/navigation.php +++ b/application/config/navigation.php @@ -62,6 +62,15 @@ $config['navigation_header'] = array( 'lehre/lehrauftrag_bestellen:r', 'lehre/lehrauftrag_erteilen:r' ) + ), + 'zgvueberpruefung' => array( + 'link' => site_url('system/infocenter/ZGVUeberpruefung'), + 'description' => 'ZGV Überprüfung', + 'expand' => true, + 'sort' => 50, + 'requiredPermissions' => array( + 'lehre/zgvpruefung:r' + ) ) ) ), diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 43de8bb60..46fe09c10 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -12,6 +12,7 @@ class InfoCenter extends Auth_Controller const APP = 'infocenter'; const TAETIGKEIT = 'bewerbung'; const FREIGABE_MAIL_VORLAGE = 'InfocenterMailFreigabeAssistenz'; + const ZGVPRUEFUNG_MAIL_VORLAGE = 'InfocenterMailZgvUeberpruefung'; const INFOCENTER_URI = 'system/infocenter/InfoCenter'; // URL prefix for this controller const INDEX_PAGE = 'index'; @@ -85,6 +86,7 @@ class InfoCenter extends Auth_Controller 'freigegeben' => 'infocenter:r', 'reihungstestAbsolviert' => 'infocenter:r', 'showDetails' => 'infocenter:r', + 'showZGVDetails' => 'infocenter:r', 'unlockPerson' => 'infocenter:rw', 'saveFormalGeprueft' => 'infocenter:rw', 'getPrestudentData' => 'infocenter:r', @@ -92,6 +94,8 @@ class InfoCenter extends Auth_Controller 'getZgvInfoForPrestudent' => 'infocenter:r', 'saveBewPriorisierung' => 'infocenter:rw', 'saveZgvPruefung' => 'infocenter:rw', + 'zgvRueckfragen' => 'infocenter:rw', + 'zgvStatusUpdate' => 'infocenter:rw', 'saveAbsage' => 'infocenter:rw', 'saveFreigabe' => 'infocenter:rw', 'getNotiz' => 'infocenter:r', @@ -117,6 +121,8 @@ class InfoCenter extends Auth_Controller $this->load->model('crm/Prestudent_model', 'PrestudentModel'); $this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel'); $this->load->model('crm/Statusgrund_model', 'StatusgrundModel'); + $this->load->model('crm/ZGVPruefung_model', 'ZGVPruefungModel'); + $this->load->model('crm/ZGVPruefungStatus_model', 'ZGVPruefungStatusModel'); $this->load->model('person/Notiz_model', 'NotizModel'); $this->load->model('person/Person_model', 'PersonModel'); $this->load->model('system/Message_model', 'MessageModel'); @@ -178,6 +184,63 @@ class InfoCenter extends Auth_Controller $this->load->view('system/infocenter/infocenterReihungstestAbsolviert.php'); } + /** + * Prestudenten/ZGV übersicht + * Holt sich die Informationen zu den ZGV vom Prestudenten und zeigt die dann an + */ + public function showZGVDetails() + { + $prestudent_id = $this->input->get('prestudent_id'); + + if (!is_numeric($prestudent_id)) + show_error('prestudent id is not numeric!'); + + $prestudentexists = $this->PrestudentModel->load($prestudent_id); + + if (isError($prestudentexists)) + show_error(getError($prestudentexists)); + + if (!hasData($prestudentexists)) + show_error('Prestudent does not exist!'); + + $zgvExist = $this->ZGVPruefungModel->loadWhere(array('prestudent_id' => $prestudent_id)); + + if (isError($zgvExist)) + show_error(getError($zgvExist)); + + if (!hasData($zgvExist)) + show_error('ZGV does not exist!'); + + $this->ZGVPruefungStatusModel->addOrder('datum', 'DESC'); + $this->ZGVPruefungStatusModel->addLimit(1); + + $statusZGV = $this->ZGVPruefungStatusModel->loadWhere(array('zgvpruefung_id' => $zgvExist->retval[0]->zgvpruefung_id)); + + if (isError($statusZGV)) + show_error(getError($statusZGV)); + + if (!hasData($statusZGV)) + show_error('ZGV has no status.'); + + $statusZGV = array('status' => $statusZGV->retval[0]->status); + $origin_page = $this->input->get(self::ORIGIN_PAGE); + + + $persondata = $this->_loadPersonData($prestudentexists->retval[0]->person_id); + + $prestudent_id = array('prestudent_id' => $prestudent_id); + $data = array_merge( + $persondata, + $prestudent_id, + $statusZGV + ); + + $data[self::FHC_CONTROLLER_ID] = $this->getControllerId(); + $data[self::ORIGIN_PAGE] = $origin_page; + $data[self::PREV_FILTER_ID] = $this->input->get(self::PREV_FILTER_ID); + + $this->load->view('system/infocenter/infocenterZgvDetails.php', $data); + } /** * Personal details page of the InfoCenter tool * Initialization function, gets person and prestudent data and loads the view with the data @@ -429,6 +492,180 @@ class InfoCenter extends Auth_Controller $this->outputJson($json); } + /** + * Sendet bei einer neuen ZGV Prüfung die Mail raus an den Studiengang + */ + private function sendZgvMail($mail){ + $data = array( + 'DataTest' => 'getestet.' + ); + $this->load->helper('hlp_sancho'); + sendSanchoMail( + self::ZGVPRUEFUNG_MAIL_VORLAGE, + $data, + $mail, + 'ZGV Ueberpruefung', + 'sancho_header_min_bw.jpg', + 'sancho_footer_min_bw.jpg' + ); + + return true; + } + + /** + * Der Status von den ZGV wird geupdated + */ + public function zgvStatusUpdate() + { + $prestudent_id = $this->input->post('prestudent_id'); + $person_id = $this->input->post('person_id'); + $status = $this->input->post('status'); + + if (isEmptyString($prestudent_id) && isEmptyString($person_id) && isEmptyString($status)) + return $this->outputJsonError('Some data is missing'); + + $zgv = $this->ZGVPruefungModel->loadWhere(array('prestudent_id' => $prestudent_id)); + + if (!hasData($zgv)) + return $this->outputJsonError('ZGV nicht gefunden'); + + $zgv = getData($zgv); + + $this->ZGVPruefungStatusModel->addOrder('datum', 'DESC'); + $this->ZGVPruefungStatusModel->addLimit(1); + $statusZGV = $this->ZGVPruefungStatusModel->loadWhere(array('zgvpruefung_id' => $zgv[0]->zgvpruefung_id)); + + if (!hasData($statusZGV)) + return $this->outputJsonError('ZGV-Status nicht gefunden'); + + $statusZGV = getData($statusZGV); + + if ($statusZGV[0]->status === 'rejected' && $status === 'rejected') + return $this->outputJsonError('Bereits abgelehnt worden'); + elseif ($statusZGV[0]->status === 'accepted' && $status === 'accepted') + return $this->outputJsonError('Bereits akzeptiert worden'); + + + $insert = $this->ZGVPruefungStatusModel->insert( + array( + 'zgvpruefung_id' => $zgv[0]->zgvpruefung_id, + 'status' => $status + ) + ); + + $update = $this->ZGVPruefungModel->update( + $zgv[0]->zgvpruefung_id, + array( + 'updateamum' => date('Y-m-d H:i:s'), + 'updatevon' => $this->_uid + ) + ); + + if (isError($insert) && isError($update)) + return $this->outputJsonError('Fehler beim Speichern'); + + $personInfos = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); + + $this->outputJsonSuccess( + array + ( + 'msg' => 'Erfolgreich gespeichert', + 'person_id' => $personInfos['person_id'] + ) + ); + + } + + /** + * Fügt einen neuen ZGV Status hinzu oder updated einen bestehenden + * Falls es erfolgreich war, sendet er die Mail raus + */ + public function zgvRueckfragen() + { + $prestudent_id = $this->input->post('prestudent_id'); + $person_id = $this->input->post('person_id'); + + if (isEmptyString($prestudent_id) && isEmptyString($person_id)) + return $this->outputJsonError('Prestudentid OR/AND Personid missing'); + + $zgv = $this->ZGVPruefungModel->loadWhere(array('prestudent_id' => $prestudent_id)); + $sg = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); + $mail = $sg['studiengang_mail']; + + if (hasData($zgv)) + { + $zgv = getData($zgv); + + $this->ZGVPruefungStatusModel->addOrder('datum', 'DESC'); + $this->ZGVPruefungStatusModel->addLimit(1); + $statusZGV = $this->ZGVPruefungStatusModel->loadWhere(array('zgvpruefung_id' => $zgv[0]->zgvpruefung_id)); + + if (!hasData($statusZGV)) + return $this->outputJsonError('ZGV-Status nicht gefunden'); + + $statusZGV = getData($statusZGV); + + if ($statusZGV[0]->status === 'pruefung_stg') + return $this->outputJsonError('Bereits in Prüfung'); + + $insert = $this->ZGVPruefungStatusModel->insert( + array( + 'zgvpruefung_id' => $zgv[0]->zgvpruefung_id, + 'status' => 'pruefung_stg' + ) + ); + + $update = $this->ZGVPruefungModel->update( + $zgv[0]->zgvpruefung_id, + array( + 'updateamum' => date('Y-m-d H:i:s'), + 'updatevon' => $this->_uid + ) + ); + + if (isSuccess($insert) && isSuccess($update)) + $mailStatus = $this->sendZgvMail($mail); + elseif (isError($insert) && isError($update)) + return $this->outputJsonError('Fehler beim Speichern'); + + }else + { + $insert = $this->ZGVPruefungModel->insert( + array( + 'prestudent_id' => $prestudent_id, + 'insertamum' => date('Y-m-d H:i:s'), + 'insertvon' => $this->_uid + ) + ); + + if (isSuccess($insert)) + { + $zgvpruefung_id = $this->ZGVPruefungModel->db->insert_id(); + $result = $this->ZGVPruefungStatusModel->insert( + array( + 'zgvpruefung_id' => $zgvpruefung_id, + 'status' => 'pruefung_stg' + ) + ); + + if (isSuccess($result)) + $mailStatus = $this->sendZgvMail($mail); + elseif (isError($result)) + return $this->outputJsonError('Fehler beim Speichern'); + } + } + if ($mailStatus) + { + $this->outputJsonSuccess( + array + ( + 'msg' => 'Erfolgreich gespeichert', + 'person_id' => $sg['person_id'] + ) + ); + } + } + /** * Saves Absage for Prestudent including the reason for the Absage (statusgrund). * inserts Studiensemester and Ausbildungssemester for the new Absage of (chronologically) last status. @@ -1421,8 +1658,20 @@ class InfoCenter extends Auth_Controller $zgvpruefung->changedown = $this->PrestudentModel->checkPrioChange($zgvpruefung->prestudent_id, $studiensemester, 1); } } + $zgvExist = $this->ZGVPruefungModel->loadWhere(array('prestudent_id' => $zgvpruefung->prestudent_id)); - $zgvpruefungen[] = $zgvpruefung; + if (isSuccess($zgvExist) && hasData($zgvExist)) + { + $this->ZGVPruefungStatusModel->addOrder('datum', 'DESC'); + $this->ZGVPruefungStatusModel->addLimit(1); + + $statusZGV = $this->ZGVPruefungStatusModel->loadWhere(array('zgvpruefung_id' => $zgvExist->retval[0]->zgvpruefung_id)); + + if (isSuccess($statusZGV) && hasData($statusZGV)) + $zgvpruefung->statusZGV = $statusZGV->retval[0]->status; + } + + $zgvpruefungen[] = $zgvpruefung; } $this->_sortPrestudents($zgvpruefungen); @@ -1545,8 +1794,9 @@ class InfoCenter extends Auth_Controller $person_id = $prestudentdata->person_id; $studiengang_kurzbz = $prestudentdata->studiengang; $studiengang_bezeichnung = $prestudentdata->studiengangbezeichnung; + $studiengang_mail = $prestudentdata->studiengangmail; - return array('person_id' => $person_id, 'studiengang_kurzbz' => $studiengang_kurzbz, 'studiengang_bezeichnung' => $studiengang_bezeichnung); + return array('person_id' => $person_id, 'studiengang_kurzbz' => $studiengang_kurzbz, 'studiengang_bezeichnung' => $studiengang_bezeichnung, 'studiengang_mail' => $studiengang_mail); } /** diff --git a/application/controllers/system/infocenter/ZGVUeberpruefung.php b/application/controllers/system/infocenter/ZGVUeberpruefung.php new file mode 100644 index 000000000..21728ea99 --- /dev/null +++ b/application/controllers/system/infocenter/ZGVUeberpruefung.php @@ -0,0 +1,33 @@ + 'lehre/zgvpruefung:r', + ) + ); + + $this->load->library('WidgetLib'); + $this->setControllerId(); // sets the controller id + } + + public function index() + { + + try{ + $this->load->view('system/infocenter/infocenterZgvUeberpruefung.php'); + }catch(Exception $e) + { + var_dump($e); + } + } +} \ No newline at end of file diff --git a/application/models/crm/ZGVPruefungStatus_model.php b/application/models/crm/ZGVPruefungStatus_model.php new file mode 100644 index 000000000..75e57cb05 --- /dev/null +++ b/application/models/crm/ZGVPruefungStatus_model.php @@ -0,0 +1,17 @@ +dbTable = 'public.tbl_zgvpruefungstatus_status'; + $this->pk = 'zgv_pruefung_status_id'; + $this->hasSequence = true; + } + +} \ No newline at end of file diff --git a/application/models/crm/ZGVPruefung_model.php b/application/models/crm/ZGVPruefung_model.php new file mode 100644 index 000000000..f8fd0a9ad --- /dev/null +++ b/application/models/crm/ZGVPruefung_model.php @@ -0,0 +1,17 @@ +dbTable = 'public.tbl_zgvpruefung'; + $this->pk = 'zgvpruefung_id'; + $this->hasSequence = true; + } + +} \ No newline at end of file diff --git a/application/views/system/infocenter/dokpruefung.php b/application/views/system/infocenter/dokpruefung.php index 7c431fc46..aa76bbd52 100644 --- a/application/views/system/infocenter/dokpruefung.php +++ b/application/views/system/infocenter/dokpruefung.php @@ -6,7 +6,10 @@ p->t('global','typ')) ?> p->t('global','uploaddatum')) ?> p->t('infocenter','ausstellungsnation')) ?> - p->t('infocenter','formalGeprueft')) ?> + " . ucfirst($this->p->t('infocenter','formalGeprueft')) . "" + ?> @@ -21,13 +24,17 @@ dokument_bezeichnung ?> erstelltam), 'd.m.Y') ?> langtext ?> - - > - - formal_geprueft_amum) ? date_format(date_create($dokument->formal_geprueft_amum), 'd.m.Y') : ''; ?> - - + + + > + + formal_geprueft_amum) ? date_format(date_create($dokument->formal_geprueft_amum), 'd.m.Y') : ''; ?> + + + diff --git a/application/views/system/infocenter/infocenterZgvDetails.php b/application/views/system/infocenter/infocenterZgvDetails.php new file mode 100644 index 000000000..c6af4c436 --- /dev/null +++ b/application/views/system/infocenter/infocenterZgvDetails.php @@ -0,0 +1,203 @@ +load->view( + 'templates/FHC-Header', + array( + 'title' => 'InfocenterZgvDetails', + 'jquery' => true, + 'bootstrap' => true, + 'fontawesome' => true, + 'jqueryui' => true, + 'dialoglib' => true, + 'ajaxlib' => true, + 'tablesorter' => true, + 'tinymce' => true, + 'sbadmintemplate' => true, + 'addons' => true, + 'navigationwidget' => true, + 'udfs' => true, + 'widgets' => true, + 'customCSSs' => array( + 'public/css/sbadmin2/admintemplate.css', + 'public/css/sbadmin2/tablesort_bootstrap.css', + 'public/css/infocenter/infocenterDetails.css' + ), + 'customJSs' => array( + 'public/js/bootstrapper.js', + 'public/js/tablesort/tablesort.js', + 'public/js/infocenter/messageList.js', + 'public/js/infocenter/infocenterDetails.js' + ), + 'phrases' => array( + 'infocenter' => array( + 'notizHinzufuegen', + 'notizAendern', + 'nichtsZumEntfernen', + 'fehlerBeimEntfernen', + 'zgvInPruefung', + 'zgvAkzeptiert', + 'zgvAbgelehnt' + ), + 'ui' => array( + 'gespeichert', + 'fehlerBeimSpeichern' + ), + 'global' => array( + 'bis', + 'zeilen' + ) + ) + ) + ); +?> + +
+ + widgetlib->widget('NavigationWidget'); ?> + +
+
+ +
+
+ +
+
+
+ p->t('global', 'wirdBearbeitetVon').': '; + echo $lockedby; + if ($origin_page == 'index'): + $unlockpath = 'unlockPerson/'.$stammdaten->person_id; + $unlockpath .= '?fhc_controller_id='.$fhc_controller_id; + $unlockpath .= '&filter_id='.$prev_filter_id; + ?> +    + +  p->t('ui', 'freigeben')) ?> + + + +   + +
+
+
+
+
+
+
+
+
+

p->t('global', 'stammdaten')) ?>

+
+
+ load->view('system/infocenter/stammdaten.php'); ?> + load->view('system/infocenter/anmerkungenZurBewerbung.php'); ?> +
+
+
+
+
+
+
+
+
+ +
+

+ p->t('infocenter', 'dokumentenpruefung')) ?> +

+
+
+ load->view('system/infocenter/dokpruefung.php', array('formalReadonly' => true)); ?> +
+ +
+ + + + p->t('infocenter', 'zgvInPruefung'); + break; + case 'accepted' : + echo $this->p->t('infocenter', 'zgvAkzeptiert'); + break; + case 'rejected' : + echo $this->p->t('infocenter', 'zgvAbgelehnt'); + break; + } + ?> + + +
+
+
+
+
+ +
+
+
+
+
+ +

+ p->t('global', 'nachrichten')) ?> +

+
+
+
+ load->view('system/infocenter/messageList.php', $messages); + ?> +
+
+
+
+
+
+
+
+
+
+
+ +

+ p->t('global', 'notizen'))?> +

+
+
+
+
+
+ load->view('system/infocenter/addNotiz.php'); ?> +
+
+ load->view('system/infocenter/notizen.php'); ?> +
+
+ +
+
+
+
+
+
+
+
+
+ + + +load->view('templates/FHC-Footer'); ?> diff --git a/application/views/system/infocenter/infocenterZgvUeberpruefung.php b/application/views/system/infocenter/infocenterZgvUeberpruefung.php new file mode 100644 index 000000000..e0b8f9eae --- /dev/null +++ b/application/views/system/infocenter/infocenterZgvUeberpruefung.php @@ -0,0 +1,49 @@ +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, + 'phrases' => array( + 'person' => array('vorname', 'nachname'), + 'global' => array('mailAnXversandt'), + 'ui' => array('bitteEintragWaehlen') + ), + 'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/infocenter/infocenterZgv.css'), + 'customJSs' => array('public/js/bootstrapper.js') + ) +); +?> + + +
+ + widgetlib->widget('NavigationWidget'); ?> + +
+
+
+
+ +
+
+
+ load->view('system/infocenter/infocenterZgvUeberpruefungData.php'); ?> +
+
+
+
+ + +load->view('templates/FHC-Footer'); ?> diff --git a/application/views/system/infocenter/infocenterZgvUeberpruefungData.php b/application/views/system/infocenter/infocenterZgvUeberpruefungData.php new file mode 100644 index 000000000..ff1b85d9e --- /dev/null +++ b/application/views/system/infocenter/infocenterZgvUeberpruefungData.php @@ -0,0 +1,63 @@ +getBerechtigungen($uid); +$oeKurz = $rechte->getOEkurzbz('lehre/zgvpruefung'); +$oeKurz = '\''. implode('\',\'', $oeKurz) . '\''; + +$query = ' + SELECT + ps.prestudent_id AS "PreStudentID", + p.vorname AS "Vorname", + p.nachname AS "Nachname", + sg.kurzbzlang AS "Studiengang" + FROM public.tbl_zgvpruefungstatus_status zgvstatus + JOIN public.tbl_zgvpruefung zgv USING (zgvpruefung_id) + JOIN public.tbl_prestudent ps USING (prestudent_id) + JOIN public.tbl_person p USING(person_id) + JOIN public.tbl_studiengang sg USING(studiengang_kz) + WHERE zgvstatus.status = ' . $STATUS . ' + AND oe_kurzbz IN ('. $oeKurz .') + AND zgvstatus.datum IN ( + SELECT MAX(zgvstatus.datum) + FROM public.tbl_zgvpruefungstatus_status zgvstatus GROUP BY zgvstatus.zgvpruefung_id) + ORDER BY ps.prestudent_id + '; + +$filterWidgetArray = array( + 'query' => $query, + 'app' => 'infocenter', + 'datasetName' => 'zgvUeberpruefung', + 'filter_id' => $this->input->get('filter_id'), + 'requiredPermissions' => 'infocenter', + 'datasetRepresentation' => 'tablesorter', + 'additionalColumns' => array('Details'), + 'hideOptions' => true, + 'columnsAliases' => array( + + ), + 'formatRow' => function($datasetRaw) { + + /* NOTE: Dont use $this here for PHP Version compatibility */ + $datasetRaw->{'Details'} = sprintf( + 'Details', + site_url('system/infocenter/InfoCenter/showZGVDetails'), + $datasetRaw->{'PreStudentID'}, + 'zgvUeberpruefung', + (isset($_GET['fhc_controller_id']) ? $_GET['fhc_controller_id'] : ''), + (isset($_GET['filter_id']) ? $_GET['filter_id'] : '') + ); + + return $datasetRaw; + }, +); + +echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray); +?> diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index 41b549616..eccbbd4ee 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -311,12 +311,34 @@
-
+
+ + + statusZGV)) + { + switch ($zgvpruefung->statusZGV) + { + case 'pruefung_stg' : + echo $this->p->t('infocenter', 'zgvInPruefung'); + break; + case 'accepted' : + echo $this->p->t('infocenter', 'zgvAkzeptiert'); + break; + case 'rejected' : + echo $this->p->t('infocenter', 'zgvAbgelehnt'); + break; + } + } + ?> +
-
+
diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 7023af277..d0668bbbc 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -221,6 +221,71 @@ var InfocenterDetails = { } ); }, + zgvRueckfragen: function(data) + { + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + '/zgvRueckfragen', + data, + { + successCallback: function(data, textStatus, jqXHR) + { + if (FHC_AjaxClient.hasData(data)) + { + var response = FHC_AjaxClient.getData(data); + + var date = new Date(); + date.setDate(date.getDate() + 14); + + var dd = date.getDate(); + var mm = date.getMonth() + 1; + var y = date.getFullYear(); + + var formatedDate = mm + '/'+ dd + '/'+ y; + InfocenterDetails.setPersonOnHold(response.person_id, formatedDate); + + $('#zgvStatusText').text(FHC_PhrasesLib.t('infocenter', 'zgvInPruefung')); + InfocenterDetails._refreshZgv(); + FHC_DialogLib.alertSuccess(response.msg); + } else if(FHC_AjaxClient.isError(data)) + FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); + }, + errorCallback: function(jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError((jqXHR.responseText)); + } + } + ); + }, + zgvStatusUpdate: function(data) + { + var status = data.status; + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + '/zgvStatusUpdate', + data, + { + successCallback: function(data, textStatus, jqXHR) + { + if (FHC_AjaxClient.hasData(data)) + { + var response = FHC_AjaxClient.getData(data) + FHC_DialogLib.alertSuccess(response.msg); + InfocenterDetails.removePersonOnHold(response.person_id); + if (status === 'rejected') + var p = 'zgvAbgelehnt' + else if (status === 'accepted') + var p = 'zgvAkzeptiert'; + $('#zgvStatusText').text(FHC_PhrasesLib.t('infocenter', p)); + } else if (FHC_AjaxClient.isError(data)) + FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); + }, + errorCallback: function(jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError((jqXHR.responseText)); + } + } + ); + }, + saveZgv: function(data) { var zgvError = function(){ @@ -746,6 +811,40 @@ var InfocenterDetails = { InfocenterDetails.zgvUebernehmen(personid, prestudentid, btn); }); + $('.zgvRueckfragen').click(function () + { + //var btn = $(this); + var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + //$('#zgvUebernehmenNotice').remove(); + var data = { + 'person_id' : personid, + 'prestudent_id' : prestudentid + } + InfocenterDetails.zgvRueckfragen(data); + }); + + $('.zgvAkzeptieren').click(function (){ + var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + + var data = { + 'person_id' : personid, + 'prestudent_id' : prestudentid, + 'status' : 'accepted' + } + InfocenterDetails.zgvStatusUpdate(data); + }); + + $('.zgvAblehnen').click(function (){ + var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + + var data = { + 'person_id' : personid, + 'prestudent_id' : prestudentid, + 'status' : 'rejected' + } + InfocenterDetails.zgvStatusUpdate(data); + }); + //zgv speichern $(".saveZgv").click(function () { diff --git a/system/checkroles.php b/system/checkroles.php index 54839437e..9fae66ad3 100644 --- a/system/checkroles.php +++ b/system/checkroles.php @@ -54,7 +54,7 @@ $data = array 'rolle_kurzbz' => 'admin', 'berechtigung' => array ( - 'admin', 'assistenz', 'basis/addon', 'basis/ampel', 'basis/ampeluebersicht', 'basis/benutzer', 'basis/berechtigung', 'basis/betriebsmittel', 'basis/cms', 'basis/cms_review', 'basis/cms_sperrfreigabe', 'basis/cronjob', 'basis/dms', 'basis/fas', 'basis/ferien', 'basis/fhausweis','basis/firma', 'basis/infoscreen', 'basis/moodle', 'basis/moodle','basis/news', 'basis/notiz', 'basis/organisationseinheit', 'basis/ort', 'basis/orgform', 'basis/person', 'basis/planner', 'basis/service', 'basis/statistik', 'basis/studiengang', 'basis/tempus', 'basis/testtool', 'basis/variable', 'basis/vilesci', 'buchung/typen', 'buchung/mitarbeiter', 'inout/incoming', 'inout/outgoing', 'inout/uebersicht', 'lehre', 'lehre/abgabetool', 'lehre/freifach', 'lehre/lehrfach', 'lehre/lehrveranstaltung', 'lehre/lvplan', 'lehre/lvinfo', 'lehre/pruefungsanmeldungAdmin', 'lehre/pruefungsbeurteilung', 'lehre/pruefungsbeurteilungAdmin', 'lehre/pruefungsterminAdmin', 'lehre/pruefungsfenster', 'lehre/reihungstest', 'lehre/reservierung', 'lehre/studienordnung', 'lehre/studienordnungInaktiv', 'lehre/studienplan', 'lehre/vorrueckung', 'lv-plan', 'lv-plan/gruppenentfernen', 'lv-plan/lektorentfernen', 'mitarbeiter', 'mitarbeiter/bankdaten', 'mitarbeiter/personalnummer', 'mitarbeiter/stammdaten', 'mitarbeiter/urlaube', 'mitarbeiter/zeitsperre', 'news', 'planner', 'preinteressent', 'raumres', 'reihungstest', 'sdTools', 'soap/lv', 'soap/lvplan', 'soap/mitarbeiter', 'soap/ort', 'soap/pruefungsfenster', 'soap/student', 'soap/studienordnung', 'soap/benutzer', 'soap/buchungen', 'student/bankdaten', 'student/anrechnung', 'student/anwesenheit', 'student/dokumente', 'student/noten', 'system/phrase', 'system/vorlage', 'system/vorlagestudiengang', 'student/stammdaten', 'student/vorrueckung', 'system/developer', 'system/loginasuser', 'user', 'veranstaltung', 'vertrag/mitarbeiter', 'vertrag/typen', 'wawi/berichte', 'wawi/bestellung', 'wawi/bestellung_advanced', 'wawi/budget', 'wawi/delete_advanced', 'wawi/firma', 'wawi/freigabe', 'wawi/freigabe_advanced', 'wawi/inventar', 'wawi/konto', 'wawi/kostenstelle', 'wawi/rechnung', 'wawi/rechnung_freigeben', 'wawi/rechnung_transfer', 'wawi/storno' + 'admin', 'assistenz', 'basis/addon', 'basis/ampel', 'basis/ampeluebersicht', 'basis/benutzer', 'basis/berechtigung', 'basis/betriebsmittel', 'basis/cms', 'basis/cms_review', 'basis/cms_sperrfreigabe', 'basis/cronjob', 'basis/dms', 'basis/fas', 'basis/ferien', 'basis/fhausweis','basis/firma', 'basis/infoscreen', 'basis/moodle', 'basis/moodle','basis/news', 'basis/notiz', 'basis/organisationseinheit', 'basis/ort', 'basis/orgform', 'basis/person', 'basis/planner', 'basis/service', 'basis/statistik', 'basis/studiengang', 'basis/tempus', 'basis/testtool', 'basis/variable', 'basis/vilesci', 'buchung/typen', 'buchung/mitarbeiter', 'inout/incoming', 'inout/outgoing', 'inout/uebersicht', 'lehre', 'lehre/abgabetool', 'lehre/freifach', 'lehre/lehrfach', 'lehre/lehrveranstaltung', 'lehre/lvplan', 'lehre/lvinfo', 'lehre/pruefungsanmeldungAdmin', 'lehre/pruefungsbeurteilung', 'lehre/pruefungsbeurteilungAdmin', 'lehre/pruefungsterminAdmin', 'lehre/pruefungsfenster', 'lehre/reihungstest', 'lehre/reservierung', 'lehre/studienordnung', 'lehre/studienordnungInaktiv', 'lehre/studienplan', 'lehre/vorrueckung', 'lehre/zgvpruefung', 'lv-plan', 'lv-plan/gruppenentfernen', 'lv-plan/lektorentfernen', 'mitarbeiter', 'mitarbeiter/bankdaten', 'mitarbeiter/personalnummer', 'mitarbeiter/stammdaten', 'mitarbeiter/urlaube', 'mitarbeiter/zeitsperre', 'news', 'planner', 'preinteressent', 'raumres', 'reihungstest', 'sdTools', 'soap/lv', 'soap/lvplan', 'soap/mitarbeiter', 'soap/ort', 'soap/pruefungsfenster', 'soap/student', 'soap/studienordnung', 'soap/benutzer', 'soap/buchungen', 'student/bankdaten', 'student/anrechnung', 'student/anwesenheit', 'student/dokumente', 'student/noten', 'system/phrase', 'system/vorlage', 'system/vorlagestudiengang', 'student/stammdaten', 'student/vorrueckung', 'system/developer', 'system/loginasuser', 'user', 'veranstaltung', 'vertrag/mitarbeiter', 'vertrag/typen', 'wawi/berichte', 'wawi/bestellung', 'wawi/bestellung_advanced', 'wawi/budget', 'wawi/delete_advanced', 'wawi/firma', 'wawi/freigabe', 'wawi/freigabe_advanced', 'wawi/inventar', 'wawi/konto', 'wawi/kostenstelle', 'wawi/rechnung', 'wawi/rechnung_freigeben', 'wawi/rechnung_transfer', 'wawi/storno' ) ) ); diff --git a/system/checksystem.php b/system/checksystem.php index 3253dd5d4..164762f3a 100644 --- a/system/checksystem.php +++ b/system/checksystem.php @@ -162,6 +162,7 @@ $berechtigungen = array( array('lehre/studienordnungInaktiv','Studienordnung Inaktiv'), array('lehre/studienplan','Studienplan'), array('lehre/vorrueckung','Lehreinheitenvorrückung'), + array('lehre/zgvpruefung','Berechtigung um ZGV Überprüfungen vorzunehmen'), array('lv-plan','Stundenplan'), array('lv-plan/gruppenentfernen','Erlaut das Entfernen von Gruppen aus LVPlan vom FAS aus'), array('lv-plan/lektorentfernen','Erlaut das Entfernen von Lektoren aus LVPlan vom FAS aus'), diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 62beadbce..a20892fb4 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4700,6 +4700,102 @@ if($result = @$db->db_query("SELECT 1 FROM system.tbl_berechtigung WHERE berecht } } + +// Add table zgvpruefungstatus +if(!$result = @$db->db_query("SELECT 1 FROM public.tbl_zgvpruefungstatus LIMIT 1;")) +{ + $qry = " + CREATE TABLE public.tbl_zgvpruefungstatus + ( + status_kurzbz character varying(32), + bezeichnung character varying(256) + ); + + ALTER TABLE public.tbl_zgvpruefungstatus ADD CONSTRAINT status_kurzbz PRIMARY KEY (status_kurzbz); + INSERT INTO public.tbl_zgvpruefungstatus(status_kurzbz, bezeichnung) VALUES('pruefung_stg', 'Wird vom Studiengang geprüft'); + INSERT INTO public.tbl_zgvpruefungstatus(status_kurzbz, bezeichnung) VALUES('rejected', 'Vom Studiengang abgelehnt'); + INSERT INTO public.tbl_zgvpruefungstatus(status_kurzbz, bezeichnung) VALUES('accepted', 'Vom Studiengang akzeptiert'); + + GRANT SELECT, INSERT, UPDATE, DELETE ON public.tbl_zgvpruefungstatus TO vilesci; + GRANT SELECT ON public.tbl_zgvpruefungstatus TO web; + "; + + if(!$db->db_query($qry)) + echo 'public.tbl_zgvpruefungstatus: '.$db->db_last_error().'
'; + else + echo ' public.tbl_zgvpruefungstatus: Tabelle hinzugefuegt
'; +} + +// Add table zgvpruefung +if(!$result = @$db->db_query("SELECT 1 FROM public.tbl_zgvpruefung LIMIT 1;")) +{ + $qry = " + CREATE TABLE public.tbl_zgvpruefung + ( + zgvpruefung_id integer NOT NULL, + prestudent_id integer NOT NULL, + insertamum timestamp without time zone, + insertvon character varying(32), + updateamum timestamp without time zone, + updatevon character varying(32) + ); + + CREATE SEQUENCE public.tbl_zgvpruefung_id_seq + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + ALTER TABLE public.tbl_zgvpruefung ADD CONSTRAINT pk_tbl_zgvpruefung PRIMARY KEY (zgvpruefung_id); + ALTER TABLE public.tbl_zgvpruefung ALTER COLUMN zgvpruefung_id SET DEFAULT nextval('public.tbl_zgvpruefung_id_seq'); + ALTER TABLE public.tbl_zgvpruefung ADD CONSTRAINT fk_tbl_zgvpruefung_student FOREIGN KEY (prestudent_id) REFERENCES public.tbl_prestudent (prestudent_id) ON DELETE RESTRICT ON UPDATE CASCADE; + + GRANT SELECT, UPDATE ON public.tbl_zgvpruefung_id_seq TO vilesci; + GRANT SELECT, INSERT, UPDATE, DELETE ON public.tbl_zgvpruefung TO vilesci; + GRANT SELECT ON public.tbl_zgvpruefung TO web; + + "; + + if(!$db->db_query($qry)) + echo 'public.tbl_zgvpruefung: '.$db->db_last_error().'
'; + else + echo ' public.tbl_zgvpruefung: Tabelle hinzugefuegt
'; +} + +// Add table zgvpruefungstatus_status +if(!$result = @$db->db_query("SELECT 1 FROM public.tbl_zgvpruefungstatus_status LIMIT 1;")) +{ + $qry = " + CREATE TABLE public.tbl_zgvpruefungstatus_status + ( + zgv_pruefung_status_id integer NOT NULL, + zgvpruefung_id integer NOT NULL, + status character varying(32), + datum timestamp without time zone DEFAULT now() + ); + + CREATE SEQUENCE public.tbl_zgvpruefungstatus_status_id_seq + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + + ALTER TABLE public.tbl_zgvpruefungstatus_status ADD CONSTRAINT pk_tbl_zgvpruefungstatus_status PRIMARY KEY (zgv_pruefung_status_id); + ALTER TABLE public.tbl_zgvpruefungstatus_status ALTER COLUMN zgv_pruefung_status_id SET DEFAULT nextval('tbl_zgvpruefungstatus_status_id_seq'); + ALTER TABLE public.tbl_zgvpruefungstatus_status ADD CONSTRAINT fk_tbl_zgvpruefung_zgvpruefung FOREIGN KEY (zgvpruefung_id) REFERENCES public.tbl_zgvpruefung (zgvpruefung_id) ON DELETE RESTRICT ON UPDATE CASCADE; + ALTER TABLE public.tbl_zgvpruefungstatus_status ADD CONSTRAINT fk_tbl_zgvpruefung_status FOREIGN KEY (status) REFERENCES public.tbl_zgvpruefungstatus (status_kurzbz) ON DELETE RESTRICT ON UPDATE CASCADE; + + GRANT SELECT, UPDATE ON public.tbl_zgvpruefungstatus_status_id_seq TO vilesci; + GRANT SELECT, INSERT, UPDATE, DELETE ON public.tbl_zgvpruefungstatus_status TO vilesci; + GRANT SELECT ON public.tbl_zgvpruefungstatus_status TO web; + "; + + if(!$db->db_query($qry)) + echo 'public.tbl_zgvpruefungstatus_status: '.$db->db_last_error().'
'; + else + echo ' public.tbl_zgvpruefungstatus_status: Tabelle hinzugefuegt
'; +} + + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; @@ -4940,6 +5036,9 @@ $tabellen=array( "public.tbl_vorlage" => array("vorlage_kurzbz","bezeichnung","anmerkung","mimetype","attribute","archivierbar","signierbar","stud_selfservice","dokument_kurzbz","insertamum","insertvon","updateamum","updatevon"), "public.tbl_vorlagedokument" => array("vorlagedokument_id","sort","vorlagestudiengang_id","dokument_kurzbz"), "public.tbl_vorlagestudiengang" => array("vorlagestudiengang_id","vorlage_kurzbz","studiengang_kz","version","text","oe_kurzbz","style","berechtigung","anmerkung_vorlagestudiengang","aktiv","sprache","subject","orgform_kurzbz","insertamum","insertvon","updateamum","updatevon"), + "public.tbl_zgvpruefungstatus" => array("status_kurzbz","bezeichnung"), + "public.tbl_zgvpruefung" => array("zgvpruefung_id","prestudent_id","insertamum","insertvon","updateamum","updatevon"), + "public.tbl_zgvpruefungstatus_status" => array("zgv_pruefung_status_id","zgvpruefung_id","status","datum"), "testtool.tbl_ablauf" => array("ablauf_id","gebiet_id","studiengang_kz","reihung","gewicht","semester", "insertamum","insertvon","updateamum", "updatevon","ablauf_vorgaben_id","studienplan_id"), "testtool.tbl_ablauf_vorgaben" => array("ablauf_vorgaben_id","studiengang_kz","sprache","sprachwahl","content_id","insertamum","insertvon","updateamum", "updatevon"), "testtool.tbl_antwort" => array("antwort_id","pruefling_id","vorschlag_id"), diff --git a/system/filtersupdate.php b/system/filtersupdate.php index 2d8daed4d..180e43cc4 100644 --- a/system/filtersupdate.php +++ b/system/filtersupdate.php @@ -401,6 +401,14 @@ $filters = array( ', 'oe_kurzbz' => null, ), + array( + 'app' => 'infocenter', + 'dataset_name' => 'zgvUeberpruefung', + 'filter_kurzbz' => 'zgvUeberpruefung', + 'description' => '{ZGV Übersicht}', + 'sort' => 4, + ), + array( 'app' => 'budget', 'dataset_name' => 'budgetoverview', diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index cbfbdcdc9..a151a723b 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -3006,6 +3006,126 @@ $phrases = array( ) ) ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvRueckfragen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ZGV Prüfung beantragen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'apply for a ZGV examination', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvAkzeptieren', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Dokumente akzeptieren', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'accept documents', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvAblehnen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Dokumente ablehnen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'reject documents', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvInPruefung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ZGV noch in Prüfung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'ZGV still in review', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvAkzeptiert', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Dokumente akzeptiert', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'accepted documents', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvAbgelehnt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Dokumente abgelehnt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'rejected documents', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'infocenter', 'category' => 'infocenter', From 23e502f02e0cad6f46ae43dce3a59589d713de54 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 25 Mar 2021 10:44:11 +0100 Subject: [PATCH 03/18] mail vorlage hinzugefuegt --- .../system/infocenter/InfoCenter.php | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 46fe09c10..41be8c6e0 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -496,10 +496,10 @@ class InfoCenter extends Auth_Controller * Sendet bei einer neuen ZGV Prüfung die Mail raus an den Studiengang */ private function sendZgvMail($mail){ - $data = array( - 'DataTest' => 'getestet.' - ); + $data = array(); + $this->load->helper('hlp_sancho'); + sendSanchoMail( self::ZGVPRUEFUNG_MAIL_VORLAGE, $data, @@ -508,8 +508,6 @@ class InfoCenter extends Auth_Controller 'sancho_header_min_bw.jpg', 'sancho_footer_min_bw.jpg' ); - - return true; } /** @@ -624,7 +622,7 @@ class InfoCenter extends Auth_Controller ); if (isSuccess($insert) && isSuccess($update)) - $mailStatus = $this->sendZgvMail($mail); + $this->sendZgvMail($mail); elseif (isError($insert) && isError($update)) return $this->outputJsonError('Fehler beim Speichern'); @@ -649,21 +647,19 @@ class InfoCenter extends Auth_Controller ); if (isSuccess($result)) - $mailStatus = $this->sendZgvMail($mail); + $this->sendZgvMail($mail); elseif (isError($result)) return $this->outputJsonError('Fehler beim Speichern'); } } - if ($mailStatus) - { - $this->outputJsonSuccess( - array - ( - 'msg' => 'Erfolgreich gespeichert', - 'person_id' => $sg['person_id'] - ) - ); - } + + $this->outputJsonSuccess( + array + ( + 'msg' => 'Erfolgreich gespeichert', + 'person_id' => $sg['person_id'] + ) + ); } /** From e791e3267f5c3c2bbf2323ab75641bcee28ae855 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 25 Mar 2021 15:52:14 +0100 Subject: [PATCH 04/18] link zur mail vorlage hinzugefuegt --- application/controllers/system/infocenter/InfoCenter.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 41be8c6e0..a441a43d9 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -496,7 +496,9 @@ class InfoCenter extends Auth_Controller * Sendet bei einer neuen ZGV Prüfung die Mail raus an den Studiengang */ private function sendZgvMail($mail){ - $data = array(); + $data = array( + 'link' => site_url('system/infocenter/ZGVUeberpruefung') + ); $this->load->helper('hlp_sancho'); From 9b57248007f3c77dba1e20c1f189bbf1a2426ee0 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 31 Mar 2021 13:12:20 +0200 Subject: [PATCH 05/18] zgv auch bei master uebernehmen --- .../views/system/infocenter/zgvpruefungen.php | 14 ++++++++------ public/js/infocenter/infocenterDetails.js | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index 41b549616..1e2f1cca4 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -259,7 +259,7 @@ echo $this->widgetlib->widget( 'Zgvmaster_widget', array(DropdownWidget::SELECTED_ELEMENT => $zgvpruefung->zgvmas_code), - array('name' => 'zgvmas', 'id' => 'zgvmas') + array('name' => 'zgvmas', 'id' => 'zgvmas_'.$zgvpruefung->prestudent_id) ); ?>
@@ -272,7 +272,8 @@ ?> + name="zgvmaort" + id="zgvmaort_prestudent_id ?>">
@@ -288,7 +289,8 @@ + name="zgvmadatum" + id="zgvmadatum_prestudent_id ?>"> @@ -301,7 +303,7 @@ echo $this->widgetlib->widget( 'Nation_widget', array(DropdownWidget::SELECTED_ELEMENT => $zgvpruefung->zgvmanation_code), - array('name' => 'zgvmanation', 'id' => 'zgvmanation') + array('name' => 'zgvmanation', 'id' => 'zgvmanation_'.$zgvpruefung->prestudent_id) ); ?> @@ -413,7 +415,7 @@ $disabledTxt = $disabledStgTxt = $this->p->t('infocenter', 'bewerbungMussAbgeschickt'); } - if ($studiengangtyp !== 'b') + /*if ($studiengangtyp !== 'b') { $disabled = 'disabled'; $disabledTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); @@ -424,7 +426,7 @@ $disabledStg = 'disabled'; $disabledStgTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); } - } + }*/ ?>
diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 7023af277..91531c02a 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -207,6 +207,22 @@ var InfocenterDetails = { $("#zgvort_" + prestudentid).val(zgvort); $("#zgvdatum_" + prestudentid).val(gerzgvdatum); $("#zgvnation_" + prestudentid).val(zgvnation); + + var zgvmas_code = prestudent.zgvmas_code !== null ? prestudent.zgvmas_code : "null"; + var zgvmaort = prestudent.zgvmaort !== null ? prestudent.zgvmaort : ""; + var zgvmadatum = prestudent.zgvmadatum; + var gerzgvmadatum = ""; + if (zgvmadatum !== null) + { + zgvmadatum = $.datepicker.parseDate("yy-mm-dd", prestudent.zgvmadatum); + gerzgvmadatum = $.datepicker.formatDate("dd.mm.yy", zgvmadatum); + } + var zgvmanation = prestudent.zgvmanation !== null ? prestudent.zgvmanation : "null"; + + $("#zgvmas_" + prestudentid).val(zgvmas_code); + $("#zgvmaort_" + prestudentid).val(zgvmaort); + $("#zgvmadatum_" + prestudentid).val(gerzgvmadatum); + $("#zgvmanation_" + prestudentid).val(zgvmanation); } else { From acdfdc028bd60e470fd7ccc3eb478db9756b946f Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 6 Apr 2021 12:31:46 +0200 Subject: [PATCH 06/18] zgv beim master nur updaten wenn es sich um einen master handelt --- .../system/infocenter/InfoCenter.php | 48 ++++++++++++------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 43de8bb60..508b65e15 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -374,12 +374,18 @@ class InfoCenter extends Auth_Controller $zgvdatum = isEmptyString($zgvdatum) ? null : date_format(date_create($zgvdatum), 'Y-m-d'); $zgvnation_code = $this->input->post('zgvnation') === 'null' ? null : $this->input->post('zgvnation'); - // zgvmasterdata - $zgvmas_code = $this->input->post('zgvmas') === 'null' ? null : $this->input->post('zgvmas'); - $zgvmaort = $this->input->post('zgvmaort'); - $zgvmadatum = $this->input->post('zgvmadatum'); - $zgvmadatum = isEmptyString($zgvmadatum) ? null : date_format(date_create($zgvmadatum), 'Y-m-d'); - $zgvmanation_code = $this->input->post('zgvmanation') === 'null' ? null : $this->input->post('zgvmanation'); + $prestudent = $this->PrestudentModel->getPrestudentWithZgv($prestudent_id); + $prestudentdata = getData($prestudent); + + if ($prestudentdata->studiengangtyp === 'm') + { + // zgvmasterdata + $zgvmas_code = $this->input->post('zgvmas') === 'null' ? null : $this->input->post('zgvmas'); + $zgvmaort = $this->input->post('zgvmaort'); + $zgvmadatum = $this->input->post('zgvmadatum'); + $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, '', self::INTERESSENTSTATUS); @@ -395,19 +401,29 @@ class InfoCenter extends Auth_Controller ); } - $prestresult = $this->PrestudentModel->update( - $prestudent_id, - array( - 'zgv_code' => $zgv_code, - 'zgvort' => $zgvort, - 'zgvdatum' => $zgvdatum, - 'zgvnation' => $zgvnation_code, + $updateArray = array( + 'zgv_code' => $zgv_code, + 'zgvort' => $zgvort, + 'zgvdatum' => $zgvdatum, + 'zgvnation' => $zgvnation_code, + 'updateamum' => date('Y-m-d H:i:s') + ); + + if ($prestudentdata->studiengangtyp === 'm') + { + $updateMasterArray = array( 'zgvmas_code' => $zgvmas_code, 'zgvmaort' => $zgvmaort, 'zgvmadatum' => $zgvmadatum, - 'zgvmanation' => $zgvmanation_code, - 'updateamum' => date('Y-m-d H:i:s') - ) + 'zgvmanation' => $zgvmanation_code + ); + + $updateArray = array_merge($updateArray, $updateMasterArray); + } + + $prestresult = $this->PrestudentModel->update( + $prestudent_id, + $updateArray ); if (isError($prestresult)) From 42d2f455613c1501364fa3457bf43f70ff2ac3eb Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 6 Apr 2021 13:51:27 +0200 Subject: [PATCH 07/18] bei den anmerkungen studiengang hinzugefuegt --- application/models/person/Notiz_model.php | 6 ++++-- .../views/system/infocenter/anmerkungenZurBewerbung.php | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/application/models/person/Notiz_model.php b/application/models/person/Notiz_model.php index 2e09875d8..fd08cc384 100644 --- a/application/models/person/Notiz_model.php +++ b/application/models/person/Notiz_model.php @@ -154,9 +154,11 @@ class Notiz_model extends DB_Model { // Join with the table public.tbl_notizzuordnung using notiz_id $this->addJoin('public.tbl_notizzuordnung', 'notiz_id'); - $this->addOrder('insertamum', 'DESC'); + $this->addJoin('public.tbl_prestudent', 'prestudent_id', 'LEFT'); + $this->addJoin('public.tbl_studiengang', 'studiengang_kz', 'LEFT'); + $this->addOrder('public.tbl_notiz.insertamum', 'DESC'); - return $this->loadWhere(array('person_id' => $person_id, 'titel LIKE' => $titel)); + return $this->loadWhere(array('public.tbl_notizzuordnung.person_id' => $person_id, 'titel LIKE' => $titel)); } /** diff --git a/application/views/system/infocenter/anmerkungenZurBewerbung.php b/application/views/system/infocenter/anmerkungenZurBewerbung.php index 85682d2a4..508f041de 100644 --- a/application/views/system/infocenter/anmerkungenZurBewerbung.php +++ b/application/views/system/infocenter/anmerkungenZurBewerbung.php @@ -15,6 +15,7 @@ insertamum), 'd.m.Y H:i:s') ?> + kurzbzlang)) ?: print_r('(' . nl2br($notiz->kurzbzlang) . ') - ') ?> text) ?> From bc7e3c5cc5a93aaeb764cfd2d4c53c5c9db69056 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 20 Apr 2021 13:51:41 +0200 Subject: [PATCH 08/18] zgv ueberpruefung hinzugefuegt --- .../system/infocenter/InfoCenter.php | 154 +++++++------- .../system/infocenter/ZGVUeberpruefung.php | 40 +++- .../models/crm/ZGVPruefungStatus_model.php | 33 +++ .../system/infocenter/infocenterData.php | 31 ++- .../system/infocenter/infocenterDetails.php | 9 +- .../infocenter/infocenterZgvDetails.php | 78 +++++-- .../infocenterZgvUeberpruefungData.php | 22 +- .../views/system/infocenter/zgvpruefungen.php | 23 +- public/js/infocenter/infocenterDetails.js | 103 +-------- public/js/infocenter/zgvUeberpruefung.js | 189 +++++++++++++++++ system/dbupdate_3.3.php | 1 + system/filtersupdate.php | 55 ++++- system/phrasesupdate.php | 196 +++++++++--------- 13 files changed, 602 insertions(+), 332 deletions(-) create mode 100644 public/js/infocenter/zgvUeberpruefung.js diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index a441a43d9..f0183c981 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -15,10 +15,13 @@ class InfoCenter extends Auth_Controller const ZGVPRUEFUNG_MAIL_VORLAGE = 'InfocenterMailZgvUeberpruefung'; const INFOCENTER_URI = 'system/infocenter/InfoCenter'; // URL prefix for this controller + const ZGV_UEBERPRUEFUNG_URI = 'system/infocenter/ZGVUeberpruefung'; const INDEX_PAGE = 'index'; const FREIGEGEBEN_PAGE = 'freigegeben'; const REIHUNGSTESTABSOLVIERT_PAGE = 'reihungstestAbsolviert'; const SHOW_DETAILS_PAGE = 'showDetails'; + const SHOW_ZGV_DETAILS_PAGE = 'showZGVDetails'; + const ZGV_UBERPRUEFUNG_PAGE = 'ZGVUeberpruefung'; const NAVIGATION_PAGE = 'navigation_page'; const ORIGIN_PAGE = 'origin_page'; @@ -64,6 +67,18 @@ class InfoCenter extends Auth_Controller 'name' => 'Note updated', 'message' => 'Note with title %s was updated', 'success' => null + ), + 'updatezgv' => array( + 'logtype' => 'Action', + 'name' => 'ZGV pruefung updated', + 'message' => 'ZGV with the ID %s was updated to %s', + 'success' => null + ), + 'newzgv' => array( + 'logtype' => 'Action', + 'name' => 'ZGV pruefung added', + 'message' => 'ZGV with the ID %s was added', + 'success' => null ) ); @@ -86,7 +101,7 @@ class InfoCenter extends Auth_Controller 'freigegeben' => 'infocenter:r', 'reihungstestAbsolviert' => 'infocenter:r', 'showDetails' => 'infocenter:r', - 'showZGVDetails' => 'infocenter:r', + 'showZGVDetails' => 'lehre/zgvpruefung:r', 'unlockPerson' => 'infocenter:rw', 'saveFormalGeprueft' => 'infocenter:rw', 'getPrestudentData' => 'infocenter:r', @@ -95,7 +110,7 @@ class InfoCenter extends Auth_Controller 'saveBewPriorisierung' => 'infocenter:rw', 'saveZgvPruefung' => 'infocenter:rw', 'zgvRueckfragen' => 'infocenter:rw', - 'zgvStatusUpdate' => 'infocenter:rw', + 'zgvStatusUpdate' => 'lehre/zgvpruefung:rw', 'saveAbsage' => 'infocenter:rw', 'saveFreigabe' => 'infocenter:rw', 'getNotiz' => 'infocenter:r', @@ -190,6 +205,8 @@ class InfoCenter extends Auth_Controller */ public function showZGVDetails() { + $this->_setNavigationMenuShowDetails(self::SHOW_ZGV_DETAILS_PAGE); + $prestudent_id = $this->input->get('prestudent_id'); if (!is_numeric($prestudent_id)) @@ -203,38 +220,26 @@ class InfoCenter extends Auth_Controller if (!hasData($prestudentexists)) show_error('Prestudent does not exist!'); - $zgvExist = $this->ZGVPruefungModel->loadWhere(array('prestudent_id' => $prestudent_id)); + $zgv = $this->ZGVPruefungStatusModel->getZgvStatusByPrestudent($prestudent_id); - if (isError($zgvExist)) - show_error(getError($zgvExist)); + if (isError($zgv)) + show_error(getError($zgv)); - if (!hasData($zgvExist)) - show_error('ZGV does not exist!'); - - $this->ZGVPruefungStatusModel->addOrder('datum', 'DESC'); - $this->ZGVPruefungStatusModel->addLimit(1); - - $statusZGV = $this->ZGVPruefungStatusModel->loadWhere(array('zgvpruefung_id' => $zgvExist->retval[0]->zgvpruefung_id)); - - if (isError($statusZGV)) - show_error(getError($statusZGV)); - - if (!hasData($statusZGV)) + if (!hasData($zgv)) show_error('ZGV has no status.'); - $statusZGV = array('status' => $statusZGV->retval[0]->status); - $origin_page = $this->input->get(self::ORIGIN_PAGE); - - - $persondata = $this->_loadPersonData($prestudentexists->retval[0]->person_id); - + $persondata = $this->_loadPersonData(getData($prestudentexists)[0]->person_id); $prestudent_id = array('prestudent_id' => $prestudent_id); + $status = array('status' => getData($zgv)[0]->status); + $data = array_merge( $persondata, $prestudent_id, - $statusZGV + $status ); + $origin_page = $this->input->get(self::ORIGIN_PAGE); + $data[self::FHC_CONTROLLER_ID] = $this->getControllerId(); $data[self::ORIGIN_PAGE] = $origin_page; $data[self::PREV_FILTER_ID] = $this->input->get(self::PREV_FILTER_ID); @@ -521,30 +526,27 @@ class InfoCenter extends Auth_Controller $person_id = $this->input->post('person_id'); $status = $this->input->post('status'); - if (isEmptyString($prestudent_id) && isEmptyString($person_id) && isEmptyString($status)) - return $this->outputJsonError('Some data is missing'); + if (isEmptyString($prestudent_id) || isEmptyString($person_id) || isEmptyString($status)) + $this->terminateWithJsonError('Some data is missing'); - $zgv = $this->ZGVPruefungModel->loadWhere(array('prestudent_id' => $prestudent_id)); + $personInfos = $this->PrestudentModel->getPrestudentWithZgv($prestudent_id); + + if (!hasData($personInfos)) + $this->terminateWithJsonError('Person id nicht gefunden'); + + $personInfos = getData($personInfos); + + $zgv = $this->ZGVPruefungStatusModel->getZgvStatusByPrestudent($prestudent_id); if (!hasData($zgv)) - return $this->outputJsonError('ZGV nicht gefunden'); + $this->terminateWithJsonError('ZGV-Status nicht gefunden'); $zgv = getData($zgv); - $this->ZGVPruefungStatusModel->addOrder('datum', 'DESC'); - $this->ZGVPruefungStatusModel->addLimit(1); - $statusZGV = $this->ZGVPruefungStatusModel->loadWhere(array('zgvpruefung_id' => $zgv[0]->zgvpruefung_id)); - - if (!hasData($statusZGV)) - return $this->outputJsonError('ZGV-Status nicht gefunden'); - - $statusZGV = getData($statusZGV); - - if ($statusZGV[0]->status === 'rejected' && $status === 'rejected') - return $this->outputJsonError('Bereits abgelehnt worden'); - elseif ($statusZGV[0]->status === 'accepted' && $status === 'accepted') - return $this->outputJsonError('Bereits akzeptiert worden'); - + if ($zgv[0]->status === 'rejected' && $status === 'rejected') + $this->terminateWithJsonError('Bereits abgelehnt worden'); + elseif ($zgv[0]->status === 'accepted' && $status === 'accepted') + $this->terminateWithJsonError('Bereits akzeptiert worden'); $insert = $this->ZGVPruefungStatusModel->insert( array( @@ -561,16 +563,23 @@ class InfoCenter extends Auth_Controller ) ); - if (isError($insert) && isError($update)) - return $this->outputJsonError('Fehler beim Speichern'); + if (isError($insert) || isError($update)) + $this->terminateWithJsonError('Fehler beim Speichern'); - $personInfos = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); + $allZgvs = $this->ZGVPruefungStatusModel->getOpenZgvByPerson($personInfos->person_id, array('pruefung_stg')); + $openZgv = false; + + if (hasData($allZgvs)) + $openZgv = true; + + $this->_log($person_id, 'updatezgv', array($zgv[0]->zgvpruefung_id, $status)); $this->outputJsonSuccess( array ( 'msg' => 'Erfolgreich gespeichert', - 'person_id' => $personInfos['person_id'] + 'person_id' => $personInfos->person_id, + 'openZgv' => $openZgv ) ); @@ -585,28 +594,19 @@ class InfoCenter extends Auth_Controller $prestudent_id = $this->input->post('prestudent_id'); $person_id = $this->input->post('person_id'); - if (isEmptyString($prestudent_id) && isEmptyString($person_id)) - return $this->outputJsonError('Prestudentid OR/AND Personid missing'); + if (isEmptyString($prestudent_id) || isEmptyString($person_id)) + $this->terminateWithJsonError('Prestudentid OR/AND Personid missing'); - $zgv = $this->ZGVPruefungModel->loadWhere(array('prestudent_id' => $prestudent_id)); - $sg = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); - $mail = $sg['studiengang_mail']; + $zgv = $this->ZGVPruefungStatusModel->getZgvStatusByPrestudent($prestudent_id); + $data = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); + $mail = $data['studiengang_mail']; if (hasData($zgv)) { $zgv = getData($zgv); - $this->ZGVPruefungStatusModel->addOrder('datum', 'DESC'); - $this->ZGVPruefungStatusModel->addLimit(1); - $statusZGV = $this->ZGVPruefungStatusModel->loadWhere(array('zgvpruefung_id' => $zgv[0]->zgvpruefung_id)); - - if (!hasData($statusZGV)) - return $this->outputJsonError('ZGV-Status nicht gefunden'); - - $statusZGV = getData($statusZGV); - - if ($statusZGV[0]->status === 'pruefung_stg') - return $this->outputJsonError('Bereits in Prüfung'); + if ($zgv[0]->status === 'pruefung_stg') + $this->terminateWithJsonError('Bereits in Prüfung'); $insert = $this->ZGVPruefungStatusModel->insert( array( @@ -615,7 +615,7 @@ class InfoCenter extends Auth_Controller ) ); - $update = $this->ZGVPruefungModel->update( + $this->ZGVPruefungModel->update( $zgv[0]->zgvpruefung_id, array( 'updateamum' => date('Y-m-d H:i:s'), @@ -623,11 +623,12 @@ class InfoCenter extends Auth_Controller ) ); - if (isSuccess($insert) && isSuccess($update)) - $this->sendZgvMail($mail); - elseif (isError($insert) && isError($update)) - return $this->outputJsonError('Fehler beim Speichern'); + $this->_log($person_id, 'updatezgv', array($zgv[0]->zgvpruefung_id, 'pruefung_stg')); + if (isSuccess($insert)) + $this->sendZgvMail($mail); + elseif (isError($insert)) + $this->terminateWithJsonError('Fehler beim Speichern'); }else { $insert = $this->ZGVPruefungModel->insert( @@ -648,18 +649,25 @@ class InfoCenter extends Auth_Controller ) ); + $this->_log($person_id, 'newzgv', array($zgvpruefung_id)); + if (isSuccess($result)) $this->sendZgvMail($mail); elseif (isError($result)) - return $this->outputJsonError('Fehler beim Speichern'); + $this->terminateWithJsonError('Fehler beim Speichern'); } } + $hold = false; + if ($this->personloglib->getOnHoldDate($person_id) !== null) + $hold = true; + $this->outputJsonSuccess( array ( 'msg' => 'Erfolgreich gespeichert', - 'person_id' => $sg['person_id'] + 'person_id' => $data['person_id'], + 'hold' => $hold ) ); } @@ -1293,9 +1301,9 @@ class InfoCenter extends Auth_Controller /** * Define the navigation menu for the showDetails page */ - private function _setNavigationMenuShowDetails() + private function _setNavigationMenuShowDetails($page = self::SHOW_DETAILS_PAGE) { - $this->load->library('NavigationLib', array(self::NAVIGATION_PAGE => self::INFOCENTER_URI.'/'.self::SHOW_DETAILS_PAGE)); + $this->load->library('NavigationLib', array(self::NAVIGATION_PAGE => self::INFOCENTER_URI.'/'.$page)); $origin_page = $this->input->get(self::ORIGIN_PAGE); @@ -1308,6 +1316,8 @@ class InfoCenter extends Auth_Controller { $link = site_url(self::INFOCENTER_URI.'/'.self::REIHUNGSTESTABSOLVIERT_PAGE); } + if ($origin_page === self::ZGV_UBERPRUEFUNG_PAGE) + $link = site_url(self::ZGV_UEBERPRUEFUNG_URI); $prevFilterId = $this->input->get(self::PREV_FILTER_ID); if (isset($prevFilterId)) @@ -1457,7 +1467,7 @@ class InfoCenter extends Auth_Controller * @param $person_id * @return array */ - private function _loadPersonData($person_id) + public function _loadPersonData($person_id) { $locked = $this->PersonLockModel->checkIfLocked($person_id, self::APP); diff --git a/application/controllers/system/infocenter/ZGVUeberpruefung.php b/application/controllers/system/infocenter/ZGVUeberpruefung.php index 21728ea99..bb0c36b66 100644 --- a/application/controllers/system/infocenter/ZGVUeberpruefung.php +++ b/application/controllers/system/infocenter/ZGVUeberpruefung.php @@ -1,9 +1,9 @@ 'lehre/zgvpruefung:r', + 'getZgvStatusByPrestudent' => 'lehre/zgvpruefung:r' ) ); + $this->load->model('crm/ZGVPruefungStatus_model', 'ZGVPruefungStatusModel'); + $this->load->model('crm/ZGVPruefung_model', 'ZGVPruefungModel'); $this->load->library('WidgetLib'); - $this->setControllerId(); // sets the controller id + + $this->setControllerId(); + $this->loadPhrases( + array( + 'infocenter' + ) + ); } public function index() { + $this->load->view('system/infocenter/infocenterZgvUeberpruefung.php'); + } - try{ - $this->load->view('system/infocenter/infocenterZgvUeberpruefung.php'); - }catch(Exception $e) - { - var_dump($e); - } + public function getZgvStatusByPrestudent() + { + $prestudent_id = $this->input->get('prestudent_id'); + + $zgvExist = $this->ZGVPruefungModel->loadWhere(array('prestudent_id' => $prestudent_id)); + + if (!hasData($zgvExist)) + $this->terminateWithJsonError('no ZGV exist'); + + $status = $this->ZGVPruefungStatusModel->getZgvStatus(getData($zgvExist)[0]->zgvpruefung_id); + + if (!hasData($status)) + $this->terminateWithJsonError('No status'); + + $status = getData($status)[0]->status; + + $this->outputJsonSuccess($status); } } \ No newline at end of file diff --git a/application/models/crm/ZGVPruefungStatus_model.php b/application/models/crm/ZGVPruefungStatus_model.php index 75e57cb05..5c51e45d8 100644 --- a/application/models/crm/ZGVPruefungStatus_model.php +++ b/application/models/crm/ZGVPruefungStatus_model.php @@ -14,4 +14,37 @@ class ZGVPruefungStatus_model extends DB_Model $this->hasSequence = true; } + public function getZgvStatus($zgvpruefung_id) + { + $this->addOrder('datum', 'DESC'); + $this->addLimit(1); + + return $this->loadWhere(array('zgvpruefung_id' => $zgvpruefung_id)); + } + + public function getZgvStatusByPrestudent($prestudent_id) + { + $this->addJoin('public.tbl_zgvpruefung', 'zgvpruefung_id'); + $this->addOrder($this->dbTable . '.datum', 'DESC'); + $this->addLimit(1); + return $this->loadWhere(array('prestudent_id' => $prestudent_id)); + } + + public function getOpenZgvByPerson($person_id, $status) + { + $query = 'SELECT status.zgvpruefung_id, status.datum, status.status + FROM public.tbl_zgvpruefungstatus_status status + INNER JOIN + ( + SELECT zgvpruefung_id, max(datum) as MaxDate + FROM public.tbl_zgvpruefungstatus_status + GROUP BY zgvpruefung_id + ) sub ON status.zgvpruefung_id = sub.zgvpruefung_id AND status.datum = sub.MaxDate + JOIN public.tbl_zgvpruefung ON status.zgvpruefung_id = public.tbl_zgvpruefung.zgvpruefung_id + JOIN public.tbl_prestudent USING (prestudent_id) + WHERE person_id = ? + AND status.status IN ?'; + + return $this->execQuery($query, array($person_id, $status)); + } } \ No newline at end of file diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 0c7030059..8c8f23b15 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -213,7 +213,24 @@ WHERE ps.person_id = p.person_id ORDER BY ps.zgvnation DESC NULLS LAST, ps.prestudent_id DESC LIMIT 1 - ) AS "ZGVNation" + ) AS "ZGVNation", + ( + SELECT tbl_organisationseinheit.bezeichnung + FROM public.tbl_benutzerfunktion + JOIN public.tbl_organisationseinheit USING(oe_kurzbz) + WHERE (tbl_benutzerfunktion.datum_von IS NULL OR tbl_benutzerfunktion.datum_von <= now()) + AND (tbl_benutzerfunktion.datum_bis IS NULL OR tbl_benutzerfunktion.datum_bis >= now()) + AND tbl_benutzerfunktion.uid = ( + SELECT l.insertvon + FROM system.tbl_log l + WHERE l.taetigkeit_kurzbz IN ('.$TAETIGKEIT_KURZBZ.') + AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') + AND l.person_id = p.person_id + ORDER BY l.zeitpunkt DESC + LIMIT 1 + ) + LIMIT 1 + ) AS "InfoCenterMitarbeiter" FROM public.tbl_person p LEFT JOIN ( SELECT tpl.person_id, @@ -298,7 +315,8 @@ ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'gesendet').')', ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'nichtGesendet').')', ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'aktiv').')', - 'ZGV Nation' + 'ZGV Nation', + 'InfoCenter Mitarbeiter' ), 'formatRow' => function($datasetRaw) { @@ -380,6 +398,15 @@ $datasetRaw->{'ZGVNation'} = '-'; } + if ($datasetRaw->{'InfoCenterMitarbeiter'} === 'InfoCenter') + { + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Ja'; + } + else + { + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Nein'; + } + return $datasetRaw; }, 'markRow' => function($datasetRaw) { diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index d8e7c21d2..a448e95ce 100644 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -25,7 +25,8 @@ 'public/js/bootstrapper.js', 'public/js/tablesort/tablesort.js', 'public/js/infocenter/messageList.js', - 'public/js/infocenter/infocenterDetails.js' + 'public/js/infocenter/infocenterDetails.js', + 'public/js/infocenter/zgvUeberpruefung.js' ), 'phrases' => array( 'infocenter' => array( @@ -43,7 +44,11 @@ 'nichtsZumEntfernen', 'fehlerBeimEntfernen', 'rueckstelldatumUeberschritten', - 'parkenZurueckstellenInfo' + 'parkenZurueckstellenInfo', + 'zgvInPruefung', + 'zgvErfuellt', + 'zgvNichtErfuellt', + 'zgvErfuelltPruefung' ), 'ui' => array( 'gespeichert', diff --git a/application/views/system/infocenter/infocenterZgvDetails.php b/application/views/system/infocenter/infocenterZgvDetails.php index c6af4c436..20c573e34 100644 --- a/application/views/system/infocenter/infocenterZgvDetails.php +++ b/application/views/system/infocenter/infocenterZgvDetails.php @@ -25,7 +25,8 @@ 'public/js/bootstrapper.js', 'public/js/tablesort/tablesort.js', 'public/js/infocenter/messageList.js', - 'public/js/infocenter/infocenterDetails.js' + 'public/js/infocenter/infocenterDetails.js', + 'public/js/infocenter/zgvUeberpruefung.js' ), 'phrases' => array( 'infocenter' => array( @@ -34,8 +35,9 @@ 'nichtsZumEntfernen', 'fehlerBeimEntfernen', 'zgvInPruefung', - 'zgvAkzeptiert', - 'zgvAbgelehnt' + 'zgvErfuellt', + 'zgvNichtErfuellt', + 'zgvErfuelltPruefung' ), 'ui' => array( 'gespeichert', @@ -116,36 +118,66 @@ load->view('system/infocenter/dokpruefung.php', array('formalReadonly' => true)); ?>
-
+
- - p->t('infocenter', 'zgvInPruefung'); - break; - case 'accepted' : - echo $this->p->t('infocenter', 'zgvAkzeptiert'); - break; - case 'rejected' : - echo $this->p->t('infocenter', 'zgvAbgelehnt'); - break; - } - ?> + + -
- +
+ +
diff --git a/application/views/system/infocenter/infocenterZgvUeberpruefungData.php b/application/views/system/infocenter/infocenterZgvUeberpruefungData.php index ff1b85d9e..d2bf62dab 100644 --- a/application/views/system/infocenter/infocenterZgvUeberpruefungData.php +++ b/application/views/system/infocenter/infocenterZgvUeberpruefungData.php @@ -4,7 +4,6 @@ $APP = '\'infocenter\''; $INTERESSENT_STATUS = '\'Interessent\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\''; -$STATUS = '\'pruefung_stg\''; $uid = get_uid(); $rechte = new benutzerberechtigung(); @@ -17,14 +16,14 @@ $query = ' ps.prestudent_id AS "PreStudentID", p.vorname AS "Vorname", p.nachname AS "Nachname", - sg.kurzbzlang AS "Studiengang" + sg.kurzbzlang AS "Studiengang", + zgvstatus.status as "Status" FROM public.tbl_zgvpruefungstatus_status zgvstatus JOIN public.tbl_zgvpruefung zgv USING (zgvpruefung_id) JOIN public.tbl_prestudent ps USING (prestudent_id) JOIN public.tbl_person p USING(person_id) JOIN public.tbl_studiengang sg USING(studiengang_kz) - WHERE zgvstatus.status = ' . $STATUS . ' - AND oe_kurzbz IN ('. $oeKurz .') + WHERE oe_kurzbz IN ('. $oeKurz .') AND zgvstatus.datum IN ( SELECT MAX(zgvstatus.datum) FROM public.tbl_zgvpruefungstatus_status zgvstatus GROUP BY zgvstatus.zgvpruefung_id) @@ -50,11 +49,24 @@ $filterWidgetArray = array( 'Details', site_url('system/infocenter/InfoCenter/showZGVDetails'), $datasetRaw->{'PreStudentID'}, - 'zgvUeberpruefung', + 'ZGVUeberpruefung', (isset($_GET['fhc_controller_id']) ? $_GET['fhc_controller_id'] : ''), (isset($_GET['filter_id']) ? $_GET['filter_id'] : '') ); + switch ($datasetRaw->{'Status'}) + { + case 'accepted' : + $datasetRaw->{'Status'} = $this->p->t('infocenter', 'zgvErfuellt'); + break; + case 'rejected' : + $datasetRaw->{'Status'} = $this->p->t('infocenter', 'zgvNichtErfuellt'); + break; + case 'accepted_pruefung' : + $datasetRaw->{'Status'} = $this->p->t('infocenter', 'zgvErfuelltPruefung'); + break; + } + return $datasetRaw; }, ); diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index eccbbd4ee..6cc9f2f7a 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -311,31 +311,14 @@
-
+
- - - statusZGV)) - { - switch ($zgvpruefung->statusZGV) - { - case 'pruefung_stg' : - echo $this->p->t('infocenter', 'zgvInPruefung'); - break; - case 'accepted' : - echo $this->p->t('infocenter', 'zgvAkzeptiert'); - break; - case 'rejected' : - echo $this->p->t('infocenter', 'zgvAbgelehnt'); - break; - } - } - ?> +
diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index d0668bbbc..6c094f23f 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -221,70 +221,6 @@ var InfocenterDetails = { } ); }, - zgvRueckfragen: function(data) - { - FHC_AjaxClient.ajaxCallPost( - CALLED_PATH + '/zgvRueckfragen', - data, - { - successCallback: function(data, textStatus, jqXHR) - { - if (FHC_AjaxClient.hasData(data)) - { - var response = FHC_AjaxClient.getData(data); - - var date = new Date(); - date.setDate(date.getDate() + 14); - - var dd = date.getDate(); - var mm = date.getMonth() + 1; - var y = date.getFullYear(); - - var formatedDate = mm + '/'+ dd + '/'+ y; - InfocenterDetails.setPersonOnHold(response.person_id, formatedDate); - - $('#zgvStatusText').text(FHC_PhrasesLib.t('infocenter', 'zgvInPruefung')); - InfocenterDetails._refreshZgv(); - FHC_DialogLib.alertSuccess(response.msg); - } else if(FHC_AjaxClient.isError(data)) - FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); - }, - errorCallback: function(jqXHR, textStatus, errorThrown) - { - FHC_DialogLib.alertError((jqXHR.responseText)); - } - } - ); - }, - zgvStatusUpdate: function(data) - { - var status = data.status; - FHC_AjaxClient.ajaxCallPost( - CALLED_PATH + '/zgvStatusUpdate', - data, - { - successCallback: function(data, textStatus, jqXHR) - { - if (FHC_AjaxClient.hasData(data)) - { - var response = FHC_AjaxClient.getData(data) - FHC_DialogLib.alertSuccess(response.msg); - InfocenterDetails.removePersonOnHold(response.person_id); - if (status === 'rejected') - var p = 'zgvAbgelehnt' - else if (status === 'accepted') - var p = 'zgvAkzeptiert'; - $('#zgvStatusText').text(FHC_PhrasesLib.t('infocenter', p)); - } else if (FHC_AjaxClient.isError(data)) - FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); - }, - errorCallback: function(jqXHR, textStatus, errorThrown) - { - FHC_DialogLib.alertError((jqXHR.responseText)); - } - } - ); - }, saveZgv: function(data) { @@ -405,8 +341,9 @@ var InfocenterDetails = { } ); }, - saveNotiz: function(personid, data) + saveNotiz: function(personid, data, callback) { + var callbackValue = data; FHC_AjaxClient.ajaxCallPost( CALLED_PATH + '/saveNotiz/' + encodeURIComponent(personid), data, @@ -416,6 +353,8 @@ var InfocenterDetails = { { InfocenterDetails._refreshNotizen(); InfocenterDetails._refreshLog(); + if ($.isFunction(callback)) + callback(callbackValue); } else { @@ -811,38 +750,8 @@ var InfocenterDetails = { InfocenterDetails.zgvUebernehmen(personid, prestudentid, btn); }); - $('.zgvRueckfragen').click(function () - { - //var btn = $(this); - var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); - //$('#zgvUebernehmenNotice').remove(); - var data = { - 'person_id' : personid, - 'prestudent_id' : prestudentid - } - InfocenterDetails.zgvRueckfragen(data); - }); - - $('.zgvAkzeptieren').click(function (){ - var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); - - var data = { - 'person_id' : personid, - 'prestudent_id' : prestudentid, - 'status' : 'accepted' - } - InfocenterDetails.zgvStatusUpdate(data); - }); - - $('.zgvAblehnen').click(function (){ - var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); - - var data = { - 'person_id' : personid, - 'prestudent_id' : prestudentid, - 'status' : 'rejected' - } - InfocenterDetails.zgvStatusUpdate(data); + $('.notizModal').on('hidden.bs.modal', function () { + $(':input', this).val(''); }); //zgv speichern diff --git a/public/js/infocenter/zgvUeberpruefung.js b/public/js/infocenter/zgvUeberpruefung.js new file mode 100644 index 000000000..e76dcee2e --- /dev/null +++ b/public/js/infocenter/zgvUeberpruefung.js @@ -0,0 +1,189 @@ +$(document).ready(function () +{ + var personid = $("#hiddenpersonid").val(); + + if ($('#zgvpruefungen').length) + { + $('#zgvpruefungen .zgvRueckfragen').each(function() { + if($(this).is(':disabled')) { + zgvUeberpruefung.checkStatus(InfocenterDetails._getPrestudentIdFromElementId($(this).attr('id'))); + } + }); + } else + { + zgvUeberpruefung.checkStatus(); + } + + $('.zgvRueckfragen').click(function () + { + var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + + var data = { + 'person_id' : personid, + 'prestudent_id' : prestudentid + } + zgvUeberpruefung.zgvRueckfragen(data); + }); + + $('.zgvAkzeptieren').click(function (){ + var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + + var data = { + 'person_id' : personid, + 'prestudent_id' : prestudentid, + 'status' : 'accepted' + } + zgvUeberpruefung.zgvStatusUpdate(data); + }); + + $('.zgvAblehnen').click(function (){ + var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + $('#inputStatus_' + prestudentid).val('rejected'); + $('#notizModal_' + prestudentid).modal('show'); + }); + + $('.zgvAkzeptierenPruefung').click(function (){ + var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + $('#inputStatus_' + prestudentid).val('accepted_pruefung'); + $('#notizModal_' + prestudentid).modal('show'); + }); + + $('.saveZgvNotiz').click(function (){ + var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + + if ($('#inputNotizTitelModal').val() === '' || $('#inputNotizTextModal').val() === '') + return FHC_DialogLib.alertWarning('Please fill out all fields'); + + var data = { + 'person_id' : personid, + 'notiztitel' : $('#inputNotizTitelModal').val(), + 'notiz' : $('#inputNotizTextModal').val(), + 'prestudent_id' : prestudentid, + 'status' : $('#inputStatus_' + prestudentid).val() + } + + InfocenterDetails.saveNotiz(personid, data, zgvUeberpruefung.zgvStatusUpdate); + + $('#notizModal_' + prestudentid).modal('hide'); + }); +}); + +var zgvUeberpruefung = { + checkStatus: function(prestudent_id) + { + if (prestudent_id === undefined) + prestudent_id = zgvUeberpruefung.getPrestudentId(); + + FHC_AjaxClient.ajaxCallGet( + "system/infocenter/ZGVUeberpruefung/getZgvStatusByPrestudent", + { + prestudent_id : prestudent_id + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.hasData(data)) + { + $('#zgvBearbeitungButtons_' + prestudent_id +' button').each(function() { + $(this).attr('disabled', false); + }); + var status = FHC_AjaxClient.getData(data); + + switch (status) + { + case 'rejected' : + $('#zgvAblehnen_' + prestudent_id).attr('disabled', true); + $('#zgvStatusText_' + prestudent_id).text(FHC_PhrasesLib.t('infocenter', 'zgvNichtErfuellt')); + break; + case 'accepted' : + $('#zgvAkzeptieren_' + prestudent_id).attr('disabled', true); + $('#zgvStatusText_' + prestudent_id).text(FHC_PhrasesLib.t('infocenter', 'zgvErfuellt')); + break; + case 'accepted_pruefung' : + $('#zgvAkzeptierenPruefung_' + prestudent_id).attr('disabled', true); + $('#zgvStatusText_' + prestudent_id).text(FHC_PhrasesLib.t('infocenter', 'zgvErfuelltPruefung')); + break; + case 'pruefung_stg' : + $('#zgvRueckfragen_' + prestudent_id).attr('disabled', true); + $('#zgvStatusText_' + prestudent_id).text(FHC_PhrasesLib.t('infocenter', 'zgvInPruefung')); + break; + } + } + }, + errorCallback: function(data, textStatus, errorThrown) + { + FHC_DialogLib.alertError(data); + }, + veilTimeout: 0 + } + ); + }, + + zgvRueckfragen: function(data) + { + var prestudent_id = data.prestudent_id; + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + '/zgvRueckfragen', + data, + { + successCallback: function(data, textStatus, jqXHR) + { + if (FHC_AjaxClient.hasData(data)) + { + zgvUeberpruefung.checkStatus(prestudent_id); + + var response = FHC_AjaxClient.getData(data); + + if (response.hold === false) + { + var datum = new Date(); + datum.setDate(datum.getDate() + 14); + var formatedDate = $.datepicker.formatDate("mm/dd/yy", datum); + InfocenterDetails.setPersonOnHold(response.person_id, formatedDate); + } + + FHC_DialogLib.alertSuccess(response.msg); + } else if(FHC_AjaxClient.isError(data)) + FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); + }, + errorCallback: function(jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError((jqXHR.responseText)); + } + } + ); + }, + + zgvStatusUpdate: function(data) + { + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + '/zgvStatusUpdate', + data, + { + successCallback: function(data, textStatus, jqXHR) + { + if (FHC_AjaxClient.hasData(data)) + { + zgvUeberpruefung.checkStatus(); + var response = FHC_AjaxClient.getData(data) + + if (response.openZgv === false) + InfocenterDetails.removePersonOnHold(response.person_id); + + FHC_DialogLib.alertSuccess(response.msg); + } else if (FHC_AjaxClient.isError(data)) + FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); + }, + errorCallback: function(jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError((jqXHR.responseText)); + } + } + ); + }, + + getPrestudentId: function() + { + var id = $('.zgvBearbeitungButtons .zgvAkzeptierenPruefung').attr('id'); + return InfocenterDetails._getPrestudentIdFromElementId(id); + } +} \ No newline at end of file diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index a20892fb4..6ccf5de37 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4715,6 +4715,7 @@ if(!$result = @$db->db_query("SELECT 1 FROM public.tbl_zgvpruefungstatus LIMIT 1 INSERT INTO public.tbl_zgvpruefungstatus(status_kurzbz, bezeichnung) VALUES('pruefung_stg', 'Wird vom Studiengang geprüft'); INSERT INTO public.tbl_zgvpruefungstatus(status_kurzbz, bezeichnung) VALUES('rejected', 'Vom Studiengang abgelehnt'); INSERT INTO public.tbl_zgvpruefungstatus(status_kurzbz, bezeichnung) VALUES('accepted', 'Vom Studiengang akzeptiert'); + INSERT INTO public.tbl_zgvpruefungstatus(status_kurzbz, bezeichnung) VALUES('accepted_pruefung', 'Vom Studiengang akzeptiert mit Prüfung'); GRANT SELECT, INSERT, UPDATE, DELETE ON public.tbl_zgvpruefungstatus TO vilesci; GRANT SELECT ON public.tbl_zgvpruefungstatus TO web; diff --git a/system/filtersupdate.php b/system/filtersupdate.php index 180e43cc4..5a5b983a2 100644 --- a/system/filtersupdate.php +++ b/system/filtersupdate.php @@ -404,11 +404,58 @@ $filters = array( array( 'app' => 'infocenter', 'dataset_name' => 'zgvUeberpruefung', - 'filter_kurzbz' => 'zgvUeberpruefung', - 'description' => '{ZGV Übersicht}', - 'sort' => 4, + 'filter_kurzbz' => 'zgvOffen', + 'description' => '{ZGV Überprüfung}', + 'sort' => 1, + 'default_filter' => true, + 'filter' => ' + { + "name": "Zgv Überprüfung", + "columns": [ + {"name": "PreStudentID"}, + {"name": "Vorname"}, + {"name": "Nachname"}, + {"name": "Studiengang"} + ], + "filters": [ + { + "name": "Status", + "condition": "stg", + "operation": "contains" + } + ] + } + ', + 'oe_kurzbz' => null, + ), + array( + 'app' => 'infocenter', + 'dataset_name' => 'zgvUeberpruefung', + 'filter_kurzbz' => 'zgvRest', + 'description' => '{ZGV abgeschlossen}', + 'sort' => 2, + 'default_filter' => true, + 'filter' => ' + { + "name": "Zgv abgeschlossen", + "columns": [ + {"name": "PreStudentID"}, + {"name": "Vorname"}, + {"name": "Nachname"}, + {"name": "Studiengang"}, + {"name": "Status"} + ], + "filters": [ + { + "name": "Status", + "condition": "stg", + "operation": "ncontains" + } + ] + } + ', + 'oe_kurzbz' => null, ), - array( 'app' => 'budget', 'dataset_name' => 'budgetoverview', diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index a151a723b..9f9c541d6 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -88,6 +88,26 @@ $phrases = array( ) ) ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'text', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Text', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'text', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'global', @@ -3006,66 +3026,86 @@ $phrases = array( ) ) ), - array( - 'app' => 'infocenter', - 'category' => 'infocenter', - 'phrase' => 'zgvRueckfragen', - 'insertvon' => 'system', - 'phrases' => array( - array( - 'sprache' => 'German', - 'text' => 'ZGV Prüfung beantragen', - 'description' => '', - 'insertvon' => 'system' - ), - array( - 'sprache' => 'English', - 'text' => 'apply for a ZGV examination', - 'description' => '', - 'insertvon' => 'system' - ) - ) - ), array( - 'app' => 'infocenter', - 'category' => 'infocenter', - 'phrase' => 'zgvAkzeptieren', - 'insertvon' => 'system', - 'phrases' => array( - array( - 'sprache' => 'German', - 'text' => 'Dokumente akzeptieren', - 'description' => '', - 'insertvon' => 'system' - ), - array( - 'sprache' => 'English', - 'text' => 'accept documents', - 'description' => '', - 'insertvon' => 'system' - ) - ) - ), + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvRueckfragen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ZGV Prüfung beantragen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'apply for a ZGV examination', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( - 'app' => 'infocenter', - 'category' => 'infocenter', - 'phrase' => 'zgvAblehnen', - 'insertvon' => 'system', - 'phrases' => array( - array( - 'sprache' => 'German', - 'text' => 'Dokumente ablehnen', - 'description' => '', - 'insertvon' => 'system' - ), - array( - 'sprache' => 'English', - 'text' => 'reject documents', - 'description' => '', - 'insertvon' => 'system' - ) - ) - ), + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvErfuellt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ZGV erfüllt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'ZGV fulfilled', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvNichtErfuellt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ZGV nicht erfüllt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'ZGV unfulfilled', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvErfuelltPruefung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ZGV erfüllt mit Prüfung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'ZGV fulfilled with exam', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'infocenter', 'category' => 'infocenter', @@ -3086,46 +3126,6 @@ $phrases = array( ) ) ), - array( - 'app' => 'infocenter', - 'category' => 'infocenter', - 'phrase' => 'zgvAkzeptiert', - 'insertvon' => 'system', - 'phrases' => array( - array( - 'sprache' => 'German', - 'text' => 'Dokumente akzeptiert', - 'description' => '', - 'insertvon' => 'system' - ), - array( - 'sprache' => 'English', - 'text' => 'accepted documents', - 'description' => '', - 'insertvon' => 'system' - ) - ) - ), - array( - 'app' => 'infocenter', - 'category' => 'infocenter', - 'phrase' => 'zgvAbgelehnt', - 'insertvon' => 'system', - 'phrases' => array( - array( - 'sprache' => 'German', - 'text' => 'Dokumente abgelehnt', - 'description' => '', - 'insertvon' => 'system' - ), - array( - 'sprache' => 'English', - 'text' => 'rejected documents', - 'description' => '', - 'insertvon' => 'system' - ) - ) - ), array( 'app' => 'infocenter', 'category' => 'infocenter', From c9bd10c3d033b14136f27150bfa0dacf7c8fbf2a Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 28 Apr 2021 16:53:43 +0200 Subject: [PATCH 09/18] zgv ueberpruefung bug fixes --- .../infocenter/infocenterZgvDetails.php | 2 +- .../infocenterZgvUeberpruefungData.php | 2 +- .../views/system/infocenter/zgvpruefungen.php | 8 ++++-- public/js/infocenter/infocenterDetails.js | 2 ++ public/js/infocenter/zgvUeberpruefung.js | 26 ++++++++----------- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/application/views/system/infocenter/infocenterZgvDetails.php b/application/views/system/infocenter/infocenterZgvDetails.php index 20c573e34..a1362d2fa 100644 --- a/application/views/system/infocenter/infocenterZgvDetails.php +++ b/application/views/system/infocenter/infocenterZgvDetails.php @@ -128,7 +128,7 @@ - +
diff --git a/application/views/system/infocenter/infocenterZgvUeberpruefungData.php b/application/views/system/infocenter/infocenterZgvUeberpruefungData.php index d2bf62dab..6614e6b2a 100644 --- a/application/views/system/infocenter/infocenterZgvUeberpruefungData.php +++ b/application/views/system/infocenter/infocenterZgvUeberpruefungData.php @@ -35,7 +35,7 @@ $filterWidgetArray = array( 'app' => 'infocenter', 'datasetName' => 'zgvUeberpruefung', 'filter_id' => $this->input->get('filter_id'), - 'requiredPermissions' => 'infocenter', + 'requiredPermissions' => 'lehre/zgvpruefung', 'datasetRepresentation' => 'tablesorter', 'additionalColumns' => array('Details'), 'hideOptions' => true, diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index 6cc9f2f7a..258353aaa 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -308,6 +308,10 @@
+ + statusZGV))) ?: print_r('data-info="need"')?>> + +
@@ -315,10 +319,10 @@ - - + statusZGV))) ?: print_r('data-info="need"')?>>
diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 6c094f23f..60e45584c 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -893,6 +893,8 @@ var InfocenterDetails = { } } ); + + zgvUeberpruefung.checkAfterReload(); }, _refreshMessages: function() { diff --git a/public/js/infocenter/zgvUeberpruefung.js b/public/js/infocenter/zgvUeberpruefung.js index e76dcee2e..a5b3dfd19 100644 --- a/public/js/infocenter/zgvUeberpruefung.js +++ b/public/js/infocenter/zgvUeberpruefung.js @@ -2,17 +2,7 @@ $(document).ready(function () { var personid = $("#hiddenpersonid").val(); - if ($('#zgvpruefungen').length) - { - $('#zgvpruefungen .zgvRueckfragen').each(function() { - if($(this).is(':disabled')) { - zgvUeberpruefung.checkStatus(InfocenterDetails._getPrestudentIdFromElementId($(this).attr('id'))); - } - }); - } else - { - zgvUeberpruefung.checkStatus(); - } + zgvUeberpruefung.checkAfterReload(); $('.zgvRueckfragen').click(function () { @@ -86,6 +76,7 @@ var zgvUeberpruefung = { $('#zgvBearbeitungButtons_' + prestudent_id +' button').each(function() { $(this).attr('disabled', false); }); + var status = FHC_AjaxClient.getData(data); switch (status) @@ -141,6 +132,7 @@ var zgvUeberpruefung = { InfocenterDetails.setPersonOnHold(response.person_id, formatedDate); } + InfocenterDetails._refreshLog(); FHC_DialogLib.alertSuccess(response.msg); } else if(FHC_AjaxClient.isError(data)) FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); @@ -155,6 +147,7 @@ var zgvUeberpruefung = { zgvStatusUpdate: function(data) { + var prestudent_id = data.prestudent_id; FHC_AjaxClient.ajaxCallPost( CALLED_PATH + '/zgvStatusUpdate', data, @@ -163,7 +156,7 @@ var zgvUeberpruefung = { { if (FHC_AjaxClient.hasData(data)) { - zgvUeberpruefung.checkStatus(); + zgvUeberpruefung.checkStatus(prestudent_id); var response = FHC_AjaxClient.getData(data) if (response.openZgv === false) @@ -181,9 +174,12 @@ var zgvUeberpruefung = { ); }, - getPrestudentId: function() + checkAfterReload: function() { - var id = $('.zgvBearbeitungButtons .zgvAkzeptierenPruefung').attr('id'); - return InfocenterDetails._getPrestudentIdFromElementId(id); + $('.zgvStatusText').each(function() { + if($(this).data('info')) { + zgvUeberpruefung.checkStatus(InfocenterDetails._getPrestudentIdFromElementId($(this).attr('id'))); + } + }); } } \ No newline at end of file From 5c339ce448cecd5480ed583f61867214c07881e2 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 28 Apr 2021 16:56:50 +0200 Subject: [PATCH 10/18] zgv ueberpruefung bug fixes --- public/js/infocenter/zgvUeberpruefung.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/public/js/infocenter/zgvUeberpruefung.js b/public/js/infocenter/zgvUeberpruefung.js index a5b3dfd19..d7de09ca6 100644 --- a/public/js/infocenter/zgvUeberpruefung.js +++ b/public/js/infocenter/zgvUeberpruefung.js @@ -61,9 +61,6 @@ $(document).ready(function () var zgvUeberpruefung = { checkStatus: function(prestudent_id) { - if (prestudent_id === undefined) - prestudent_id = zgvUeberpruefung.getPrestudentId(); - FHC_AjaxClient.ajaxCallGet( "system/infocenter/ZGVUeberpruefung/getZgvStatusByPrestudent", { From d490eb4323c46dd3e6e102a4e7fc9d23426f3e79 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 29 Apr 2021 11:12:48 +0200 Subject: [PATCH 11/18] freigabe nur fuer den bachelor --- application/views/system/infocenter/zgvpruefungen.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index 1e2f1cca4..c80a4e15c 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -415,7 +415,7 @@ $disabledTxt = $disabledStgTxt = $this->p->t('infocenter', 'bewerbungMussAbgeschickt'); } - /*if ($studiengangtyp !== 'b') + if ($studiengangtyp !== 'b') { $disabled = 'disabled'; $disabledTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); @@ -426,7 +426,7 @@ $disabledStg = 'disabled'; $disabledStgTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); } - }*/ + } ?>
From 6f885fb924656bee76636e0bbec22a8d82766d00 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Fri, 7 May 2021 22:23:48 +0200 Subject: [PATCH 12/18] fixed typo and put the insert on a other position --- application/models/system/Variablenname_model.php | 2 +- system/dbupdate_3.3.php | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/application/models/system/Variablenname_model.php b/application/models/system/Variablenname_model.php index 005834f67..869a03275 100644 --- a/application/models/system/Variablenname_model.php +++ b/application/models/system/Variablenname_model.php @@ -12,7 +12,7 @@ class Variablenname_model extends DB_Model ) sem WHERE start > now() LIMIT 1;', - 'infocenter_studiensgangtyp' => 'SELECT infocenter_studiensgangtyp FROM public.tbl_variablename LIMIT 1' + 'infocenter_studiensgangtyp' => 'SELECT infocenter_studiensgangtyp FROM public.tbl_variablenname LIMIT 1' ); /** diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index f8d569cd7..8c105f470 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -3232,7 +3232,6 @@ if(!@$db->db_query("SELECT 0 FROM public.tbl_variablenname WHERE 0 = 1")) INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'kontofilterstg\', \'false\'); INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'kollision_student\', \'false\'); INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'infocenter_studiensemester\', null); - INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'infocenter_studiensgangtyp\', \'b\'); INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'ignore_zeitsperre\', \'false\'); INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'ignore_reservierung\', \'false\'); INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'ignore_kollision\', \'false\'); @@ -3266,6 +3265,20 @@ if(!@$db->db_query("SELECT 0 FROM public.tbl_variablenname WHERE 0 = 1")) echo '
Granted privileges to vilesci on public.tbl_variablenname'; } +// Add new name type in public.tbl_variablenname +if ($result = @$db->db_query("SELECT 1 FROM public.tbl_variablenname WHERE name = 'infocenter_studiensgangtyp';")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = "INSERT INTO public.tbl_variablenname(name, defaultwert) VALUES('infocenter_studiensgangtyp', 'b');"; + + if (!$db->db_query($qry)) + echo 'public.tbl_variablenname '.$db->db_last_error().'
'; + else + echo 'public.tbl_variablenname: Added name "infocenter_studiensgangtyp"
'; + } +} + // Add column projektphase_id to tbl_zeitaufzeichnung if(!$result = @$db->db_query("SELECT projektphase_id FROM campus.tbl_zeitaufzeichnung LIMIT 1")) { From ffa7abdf5a3118d97cf315b71eec387cae24fe93 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 12 May 2021 13:52:19 +0200 Subject: [PATCH 13/18] standardtitel hinzugefuegt --- public/js/infocenter/zgvUeberpruefung.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/js/infocenter/zgvUeberpruefung.js b/public/js/infocenter/zgvUeberpruefung.js index d7de09ca6..37189d9fb 100644 --- a/public/js/infocenter/zgvUeberpruefung.js +++ b/public/js/infocenter/zgvUeberpruefung.js @@ -30,12 +30,14 @@ $(document).ready(function () var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); $('#inputStatus_' + prestudentid).val('rejected'); $('#notizModal_' + prestudentid).modal('show'); + $('#notizModal_' + prestudentid + ' #inputNotizTitelModal').val('ZGV wurde nicht erfüllt') }); $('.zgvAkzeptierenPruefung').click(function (){ var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); $('#inputStatus_' + prestudentid).val('accepted_pruefung'); $('#notizModal_' + prestudentid).modal('show'); + $('#notizModal_' + prestudentid + ' #inputNotizTitelModal').val('ZGV erfüllt mit Prüfung') }); $('.saveZgvNotiz').click(function (){ From 6550fb6301f1929a7fb8411ae7eceff4e8d7cb23 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Mon, 31 May 2021 13:29:13 +0200 Subject: [PATCH 14/18] wording angepasst --- public/js/infocenter/zgvUeberpruefung.js | 2 +- system/phrasesupdate.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/js/infocenter/zgvUeberpruefung.js b/public/js/infocenter/zgvUeberpruefung.js index 37189d9fb..0be4dfdad 100644 --- a/public/js/infocenter/zgvUeberpruefung.js +++ b/public/js/infocenter/zgvUeberpruefung.js @@ -37,7 +37,7 @@ $(document).ready(function () var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); $('#inputStatus_' + prestudentid).val('accepted_pruefung'); $('#notizModal_' + prestudentid).modal('show'); - $('#notizModal_' + prestudentid + ' #inputNotizTitelModal').val('ZGV erfüllt mit Prüfung') + $('#notizModal_' + prestudentid + ' #inputNotizTitelModal').val('ZGV mit Prüfungen erfüllt') }); $('.saveZgvNotiz').click(function (){ diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 9f9c541d6..f5bfc2578 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -3094,7 +3094,7 @@ $phrases = array( 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'ZGV erfüllt mit Prüfung', + 'text' => 'ZGV mit Prüfungen erfüllt', 'description' => '', 'insertvon' => 'system' ), From 4a2c90ac605d62558cdff4415d00a9a21df77aa7 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Mon, 7 Jun 2021 12:28:32 +0200 Subject: [PATCH 15/18] doktypen in zgv uebersicht nur readonly --- application/controllers/system/infocenter/InfoCenter.php | 6 +++++- application/views/system/infocenter/dokpruefung.php | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 621563c71..44d393e86 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -133,6 +133,7 @@ class InfoCenter extends Auth_Controller // Loads models $this->load->model('crm/Akte_model', 'AkteModel'); + $this->load->model('crm/Dokument_model', 'DokumentModel'); $this->load->model('crm/Prestudent_model', 'PrestudentModel'); $this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel'); $this->load->model('crm/Statusgrund_model', 'StatusgrundModel'); @@ -232,10 +233,13 @@ class InfoCenter extends Auth_Controller $prestudent_id = array('prestudent_id' => $prestudent_id); $status = array('status' => getData($zgv)[0]->status); + $dokumentdata = array('dokumententypen' => (getData($this->DokumentModel->load()))); + $data = array_merge( $persondata, $prestudent_id, - $status + $status, + $dokumentdata ); $origin_page = $this->input->get(self::ORIGIN_PAGE); diff --git a/application/views/system/infocenter/dokpruefung.php b/application/views/system/infocenter/dokpruefung.php index aa76bbd52..7ee77e815 100644 --- a/application/views/system/infocenter/dokpruefung.php +++ b/application/views/system/infocenter/dokpruefung.php @@ -21,7 +21,14 @@ titel) ? $dokument->bezeichnung : $dokument->titel ?> - dokument_bezeichnung ?> + + + erstelltam), 'd.m.Y') ?> langtext ?> Date: Thu, 10 Jun 2021 12:01:01 +0200 Subject: [PATCH 16/18] dokumententypen nach bezeichnung sortiert --- application/controllers/system/infocenter/InfoCenter.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 44d393e86..f2a63c46b 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -233,6 +233,7 @@ class InfoCenter extends Auth_Controller $prestudent_id = array('prestudent_id' => $prestudent_id); $status = array('status' => getData($zgv)[0]->status); + $this->DokumentModel->addOrder('bezeichnung'); $dokumentdata = array('dokumententypen' => (getData($this->DokumentModel->load()))); $data = array_merge( From c9ec4cb6749b5ea7b85ea3141a5afcb2b73f3867 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 10 Jun 2021 12:19:42 +0200 Subject: [PATCH 17/18] ist infocentermitarbeiter spalte nachgezogen --- .../infocenter/infocenterFreigegebenData.php | 32 +++++++++++++++++-- .../infocenterReihungstestAbsolviertData.php | 32 +++++++++++++++++-- system/filtersupdate.php | 9 ++++++ 3 files changed, 69 insertions(+), 4 deletions(-) diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index 3b7ff1dbe..62ecaef96 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -207,7 +207,24 @@ WHERE ps.person_id = p.person_id ORDER BY ps.zgvnation DESC NULLS LAST, ps.prestudent_id DESC LIMIT 1 - ) AS "ZGVNation" + ) AS "ZGVNation", + ( + SELECT tbl_organisationseinheit.bezeichnung + FROM public.tbl_benutzerfunktion + JOIN public.tbl_organisationseinheit USING(oe_kurzbz) + WHERE (tbl_benutzerfunktion.datum_von IS NULL OR tbl_benutzerfunktion.datum_von <= now()) + AND (tbl_benutzerfunktion.datum_bis IS NULL OR tbl_benutzerfunktion.datum_bis >= now()) + AND tbl_benutzerfunktion.uid = ( + SELECT l.insertvon + FROM system.tbl_log l + WHERE l.taetigkeit_kurzbz IN ('.$TAETIGKEIT_KURZBZ.') + AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') + AND l.person_id = p.person_id + ORDER BY l.zeitpunkt DESC + LIMIT 1 + ) + LIMIT 1 + ) AS "InfoCenterMitarbeiter" FROM public.tbl_person p LEFT JOIN ( SELECT tpl.person_id, @@ -275,7 +292,8 @@ 'Reihungstest angetreten', 'Reihungstest angemeldet', 'Reihungstest date', - 'ZGV Nation' + 'ZGV Nation', + 'InfoCenter Mitarbeiter' ), 'formatRow' => function($datasetRaw) { @@ -368,6 +386,16 @@ { $datasetRaw->{'ZGVNation'} = '-'; } + + if ($datasetRaw->{'InfoCenterMitarbeiter'} === 'InfoCenter') + { + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Ja'; + } + else + { + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Nein'; + } + return $datasetRaw; }, 'markRow' => function($datasetRaw) { diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php index 6b0918174..b11fdc481 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php @@ -163,7 +163,24 @@ WHERE ps.person_id = p.person_id ORDER BY ps.zgvnation DESC NULLS LAST, ps.prestudent_id DESC LIMIT 1 - ) AS "ZGVNation" + ) AS "ZGVNation", + ( + SELECT tbl_organisationseinheit.bezeichnung + FROM public.tbl_benutzerfunktion + JOIN public.tbl_organisationseinheit USING(oe_kurzbz) + WHERE (tbl_benutzerfunktion.datum_von IS NULL OR tbl_benutzerfunktion.datum_von <= now()) + AND (tbl_benutzerfunktion.datum_bis IS NULL OR tbl_benutzerfunktion.datum_bis >= now()) + AND tbl_benutzerfunktion.uid = ( + SELECT l.insertvon + FROM system.tbl_log l + WHERE l.taetigkeit_kurzbz IN ('.$TAETIGKEIT_KURZBZ.') + AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') + AND l.person_id = p.person_id + ORDER BY l.zeitpunkt DESC + LIMIT 1 + ) + LIMIT 1 + ) AS "InfoCenterMitarbeiter" FROM public.tbl_person p LEFT JOIN ( SELECT tpl.person_id, @@ -222,7 +239,8 @@ 'Reihungstest angetreten', 'Reihungstest angemeldet', 'Reihungstest Datum', - 'ZGV Nation' + 'ZGV Nation', + 'InfoCenter Mitarbeiter' ), 'formatRow' => function($datasetRaw) { @@ -310,6 +328,16 @@ { $datasetRaw->{'ZGVNation'} = '-'; } + + if ($datasetRaw->{'InfoCenterMitarbeiter'} === 'InfoCenter') + { + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Ja'; + } + else + { + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Nein'; + } + return $datasetRaw; }, 'markRow' => function($datasetRaw) { diff --git a/system/filtersupdate.php b/system/filtersupdate.php index 5a5b983a2..4624dc042 100644 --- a/system/filtersupdate.php +++ b/system/filtersupdate.php @@ -38,6 +38,7 @@ $filters = array( {"name": "LastAction"}, {"name": "LastActionType"}, {"name": "User/Operator"}, + {"name": "InfoCenterMitarbeiter"}, {"name": "LockUser"} ], "filters": [ @@ -71,6 +72,7 @@ $filters = array( {"name": "LastAction"}, {"name": "LastActionType"}, {"name": "User/Operator"}, + {"name": "InfoCenterMitarbeiter"}, {"name": "LockUser"} ], "filters": [ @@ -108,6 +110,7 @@ $filters = array( {"name": "LastAction"}, {"name": "LastActionType"}, {"name": "User/Operator"}, + {"name": "InfoCenterMitarbeiter"}, {"name": "LockUser"}, {"name": "StgNichtAbgeschickt"}, {"name": "StgAbgeschickt"}, @@ -142,6 +145,7 @@ $filters = array( {"name": "ZGVNation"}, {"name": "LastAction"}, {"name": "User/Operator"}, + {"name": "InfoCenterMitarbeiter"}, {"name": "LockUser"}, {"name": "StgNichtAbgeschickt"}, {"name": "StgAbgeschickt"}, @@ -184,6 +188,7 @@ $filters = array( {"name": "Studiensemester"}, {"name": "LastAction"}, {"name": "User/Operator"}, + {"name": "InfoCenterMitarbeiter"}, {"name": "LockUser"} ], "filters": [ @@ -220,6 +225,7 @@ $filters = array( {"name": "ZGVNation"}, {"name": "LastAction"}, {"name": "User/Operator"}, + {"name": "InfoCenterMitarbeiter"}, {"name": "LockUser"}, {"name": "StgNichtAbgeschickt"}, {"name": "StgAbgeschickt"}, @@ -266,6 +272,7 @@ $filters = array( {"name": "StgAbgeschickt"}, {"name": "LastAction"}, {"name": "User/Operator"}, + {"name": "InfoCenterMitarbeiter"}, {"name": "LockUser"}, {"name": "Statusgrund"} ], @@ -302,6 +309,7 @@ $filters = array( {"name": "LastAction"}, {"name": "LastActionType"}, {"name": "User/Operator"}, + {"name": "InfoCenterMitarbeiter"}, {"name": "LockUser"}, {"name": "Statusgrund"}, {"name": "Studiensemester"}, @@ -383,6 +391,7 @@ $filters = array( {"name": "StgAbgeschickt"}, {"name": "LastAction"}, {"name": "User/Operator"}, + {"name": "InfoCenterMitarbeiter"}, {"name": "LockUser"} ], "filters": [ From 6a3fb14ea66ffd4af21df6844c998beb11673775 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 16 Jun 2021 09:16:15 +0200 Subject: [PATCH 18/18] zgv ueberpruefung zwischen master und bachelor unterscheiden --- .../controllers/system/infocenter/InfoCenter.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index f2a63c46b..db62748fa 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -13,6 +13,7 @@ class InfoCenter extends Auth_Controller const TAETIGKEIT = 'bewerbung'; const FREIGABE_MAIL_VORLAGE = 'InfocenterMailFreigabeAssistenz'; const ZGVPRUEFUNG_MAIL_VORLAGE = 'InfocenterMailZgvUeberpruefung'; + const ZGVPRUEFUNG_MAIL_VORLAGE_MASTER = 'InfocenterMailZgvUeberpruefungM'; const INFOCENTER_URI = 'system/infocenter/InfoCenter'; // URL prefix for this controller const ZGV_UEBERPRUEFUNG_URI = 'system/infocenter/ZGVUeberpruefung'; @@ -521,7 +522,7 @@ class InfoCenter extends Auth_Controller /** * Sendet bei einer neuen ZGV Prüfung die Mail raus an den Studiengang */ - private function sendZgvMail($mail){ + private function sendZgvMail($mail, $typ){ $data = array( 'link' => site_url('system/infocenter/ZGVUeberpruefung') ); @@ -529,7 +530,7 @@ class InfoCenter extends Auth_Controller $this->load->helper('hlp_sancho'); sendSanchoMail( - self::ZGVPRUEFUNG_MAIL_VORLAGE, + ($typ === 'm' ? self::ZGVPRUEFUNG_MAIL_VORLAGE_MASTER : self::ZGVPRUEFUNG_MAIL_VORLAGE), $data, $mail, 'ZGV Ueberpruefung', @@ -622,6 +623,8 @@ class InfoCenter extends Auth_Controller $data = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); $mail = $data['studiengang_mail']; + $typ = $data['studiengang_typ']; + if (hasData($zgv)) { $zgv = getData($zgv); @@ -647,7 +650,7 @@ class InfoCenter extends Auth_Controller $this->_log($person_id, 'updatezgv', array($zgv[0]->zgvpruefung_id, 'pruefung_stg')); if (isSuccess($insert)) - $this->sendZgvMail($mail); + $this->sendZgvMail($mail, $typ); elseif (isError($insert)) $this->terminateWithJsonError('Fehler beim Speichern'); }else @@ -673,7 +676,7 @@ class InfoCenter extends Auth_Controller $this->_log($person_id, 'newzgv', array($zgvpruefung_id)); if (isSuccess($result)) - $this->sendZgvMail($mail); + $this->sendZgvMail($mail, $typ); elseif (isError($result)) $this->terminateWithJsonError('Fehler beim Speichern'); } @@ -1824,8 +1827,9 @@ class InfoCenter extends Auth_Controller $studiengang_kurzbz = $prestudentdata->studiengang; $studiengang_bezeichnung = $prestudentdata->studiengangbezeichnung; $studiengang_mail = $prestudentdata->studiengangmail; + $studiengang_typ = $prestudentdata->studiengangtyp; - return array('person_id' => $person_id, 'studiengang_kurzbz' => $studiengang_kurzbz, 'studiengang_bezeichnung' => $studiengang_bezeichnung, 'studiengang_mail' => $studiengang_mail); + return array('person_id' => $person_id, 'studiengang_kurzbz' => $studiengang_kurzbz, 'studiengang_bezeichnung' => $studiengang_bezeichnung, 'studiengang_mail' => $studiengang_mail, 'studiengang_typ' => $studiengang_typ); } /**