diff --git a/FHC-vendor/jquery-tablesorter/package.json b/FHC-vendor/jquery-tablesorter/package.json index b16fcb45e..110042959 100644 --- a/FHC-vendor/jquery-tablesorter/package.json +++ b/FHC-vendor/jquery-tablesorter/package.json @@ -56,7 +56,7 @@ ] }, "devDependencies": { - "grunt": "^0.4.5", + "grunt": "^1.3.0", "grunt-cli": "~0.1.13", "grunt-contrib-clean": "^0.7.0", "grunt-contrib-concat": "^0.5.1", 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 @@ + 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/jobs/LehrauftragJob.php b/application/controllers/jobs/LehrauftragJob.php index 4ba327a2f..7f5754595 100644 --- a/application/controllers/jobs/LehrauftragJob.php +++ b/application/controllers/jobs/LehrauftragJob.php @@ -383,8 +383,8 @@ class LehrauftragJob extends JOB_Controller } // Else if UID exists else { - // Search if studiensemester exists - $ss_index = array_search($data['studiensemester_kurzbz'], array_column($mail_data_arr, 'studiensemester_kurzbz')); + // Search if studiensemester exists inside the existing UID array + $ss_index = array_search($data['studiensemester_kurzbz'], array_column($mail_data_arr[$uid_index], 'studiensemester_kurzbz')); // If studiensemester is new, add studiensemester to existing UID if ($ss_index === false) @@ -394,13 +394,6 @@ class LehrauftragJob extends JOB_Controller $data[$i] ); } - // Else if studiensemester exists - else - { - // Add corresponding data to existing studiensemester of UID - $mail_data_arr[$uid_index]['studiensemester_kurbz'][] = $data[$i]; - } - } } } diff --git a/application/controllers/system/Variables.php b/application/controllers/system/Variables.php index 20303118b..c56407416 100644 --- a/application/controllers/system/Variables.php +++ b/application/controllers/system/Variables.php @@ -20,7 +20,8 @@ class Variables extends Auth_Controller array( 'setVar' => '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/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 43de8bb60..44a1cf327 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -12,12 +12,17 @@ class InfoCenter extends Auth_Controller const APP = 'infocenter'; 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'; 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'; @@ -63,13 +68,32 @@ 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 + ), + 'updatedoctyp' => array( + 'logtype' => 'Action', + 'name' => 'Document type updated', + 'message' => 'Type of Document %s was updated, set to %s', + 'success' => null + ), ); // Name of Interessentenstatus const INTERESSENTSTATUS = 'Interessent'; const ABGEWIESENERSTATUS = 'Abgewiesener'; const BEWERBERSTATUS = 'Bewerber'; + const WARTENDER = 'Wartender'; // Statusgruende for which no Studiengangsfreigabemessage should be sent private $_statusgruendeNoStgFreigabeMessage = array('FIT Programm', 'FIT program', 'FIT programme'); @@ -85,13 +109,18 @@ class InfoCenter extends Auth_Controller 'freigegeben' => 'infocenter:r', 'reihungstestAbsolviert' => 'infocenter:r', 'showDetails' => 'infocenter:r', + 'showZGVDetails' => 'lehre/zgvpruefung:r', 'unlockPerson' => 'infocenter:rw', 'saveFormalGeprueft' => 'infocenter:rw', + 'saveDocTyp' => 'infocenter:rw', + 'saveNachreichung' => 'infocenter:rw', 'getPrestudentData' => 'infocenter:r', 'getLastPrestudentWithZgvJson' => 'infocenter:r', 'getZgvInfoForPrestudent' => 'infocenter:r', 'saveBewPriorisierung' => 'infocenter:rw', 'saveZgvPruefung' => 'infocenter:rw', + 'zgvRueckfragen' => 'infocenter:rw', + 'zgvStatusUpdate' => 'lehre/zgvpruefung:rw', 'saveAbsage' => 'infocenter:rw', 'saveFreigabe' => 'infocenter:rw', 'getNotiz' => 'infocenter:r', @@ -99,6 +128,7 @@ class InfoCenter extends Auth_Controller 'updateNotiz' => 'infocenter:rw', 'reloadZgvPruefungen' => 'infocenter:r', 'reloadMessages' => 'infocenter:r', + 'reloadDoks' => 'infocenter:r', 'reloadNotizen' => 'infocenter:r', 'reloadLogs' => 'infocenter:r', 'outputAkteContent' => 'infocenter:r', @@ -108,15 +138,20 @@ class InfoCenter extends Auth_Controller 'setOnHold' => 'infocenter:rw', 'removeOnHold' => 'infocenter:rw', 'getStudienjahrEnd' => 'infocenter:r', - 'setNavigationMenuArrayJson' => 'infocenter:r' + 'setNavigationMenuArrayJson' => 'infocenter:r', + 'getAbsageData' => 'infocenter:r', + 'saveAbsageForAll' => 'infocenter:rw' ) ); // 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'); + $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 +213,59 @@ 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() + { + $this->_setNavigationMenuShowDetails(self::SHOW_ZGV_DETAILS_PAGE); + + $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!'); + + $zgv = $this->ZGVPruefungStatusModel->getZgvStatusByPrestudent($prestudent_id); + + if (isError($zgv)) + show_error(getError($zgv)); + + if (!hasData($zgv)) + show_error('ZGV has no status.'); + + $persondata = $this->_loadPersonData(getData($prestudentexists)[0]->person_id); + $prestudent_id = array('prestudent_id' => $prestudent_id); + $status = array('status' => getData($zgv)[0]->status); + $prestudent_data = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); + + $this->DokumentModel->addOrder('bezeichnung'); + $dokumentdata = array('dokumententypen' => (getData($this->DokumentModel->load()))); + + $data = array_merge( + $persondata, + $prestudent_id, + $status, + $dokumentdata, + $prestudent_data + ); + + $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); + + $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 @@ -211,9 +299,13 @@ class InfoCenter extends Auth_Controller $persondata = $this->_loadPersonData($person_id); $prestudentdata = $this->_loadPrestudentData($person_id); + $this->DokumentModel->addOrder('bezeichnung'); + $dokumentdata = array('dokumententypen' => (getData($this->DokumentModel->load()))); + $data = array_merge( $persondata, - $prestudentdata + $prestudentdata, + $dokumentdata ); $data[self::FHC_CONTROLLER_ID] = $this->getControllerId(); @@ -374,12 +466,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 +493,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)) @@ -429,15 +537,195 @@ 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, $typ){ + $data = array( + 'link' => site_url('system/infocenter/ZGVUeberpruefung') + ); + + $this->load->helper('hlp_sancho'); + + sendSanchoMail( + ($typ === 'm' ? self::ZGVPRUEFUNG_MAIL_VORLAGE_MASTER : self::ZGVPRUEFUNG_MAIL_VORLAGE), + $data, + $mail, + 'ZGV Ueberpruefung', + 'sancho_header_min_bw.jpg', + 'sancho_footer_min_bw.jpg' + ); + } + + /** + * 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)) + $this->terminateWithJsonError('Some data is missing'); + + $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)) + $this->terminateWithJsonError('ZGV-Status nicht gefunden'); + + $zgv = getData($zgv); + + 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( + '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)) + $this->terminateWithJsonError('Fehler beim Speichern'); + + $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, + 'openZgv' => $openZgv + ) + ); + + } + + /** + * 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)) + $this->terminateWithJsonError('Prestudentid OR/AND Personid missing'); + + $zgv = $this->ZGVPruefungStatusModel->getZgvStatusByPrestudent($prestudent_id); + + $data = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); + $mail = $data['studiengang_mail']; + $typ = $data['studiengang_typ']; + + if (hasData($zgv)) + { + $zgv = getData($zgv); + + if ($zgv[0]->status === 'pruefung_stg') + $this->terminateWithJsonError('Bereits in Prüfung'); + + $insert = $this->ZGVPruefungStatusModel->insert( + array( + 'zgvpruefung_id' => $zgv[0]->zgvpruefung_id, + 'status' => 'pruefung_stg' + ) + ); + + $this->ZGVPruefungModel->update( + $zgv[0]->zgvpruefung_id, + array( + 'updateamum' => date('Y-m-d H:i:s'), + 'updatevon' => $this->_uid + ) + ); + + $this->_log($person_id, 'updatezgv', array($zgv[0]->zgvpruefung_id, 'pruefung_stg')); + + if (isSuccess($insert)) + $this->sendZgvMail($mail, $typ); + elseif (isError($insert)) + $this->terminateWithJsonError('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' + ) + ); + + $this->_log($person_id, 'newzgv', array($zgvpruefung_id)); + + if (isSuccess($result)) + $this->sendZgvMail($mail, $typ); + elseif (isError($result)) + $this->terminateWithJsonError('Fehler beim Speichern'); + } + } + + $hold = false; + if ($this->personloglib->getOnHoldDate($person_id) !== null) + $hold = true; + + $this->outputJsonSuccess( + array + ( + 'msg' => 'Erfolgreich gespeichert', + 'person_id' => $data['person_id'], + 'hold' => $hold + ) + ); + } + /** * Saves Absage for Prestudent including the reason for the Absage (statusgrund). * inserts Studiensemester and Ausbildungssemester for the new Absage of (chronologically) last status. */ - public function saveAbsage() + public function saveAbsage($prestudent_id = null, $statusgrund = null) { $json = null; - $prestudent_id = $this->input->post('prestudent_id'); - $statusgrund = $this->input->post('statusgrund'); + if (is_null($prestudent_id)) + $prestudent_id = $this->input->post('prestudent_id'); + + if (is_null($statusgrund)) + $statusgrund = $this->input->post('statusgrund'); $lastStatus = $this->PrestudentstatusModel->getLastStatus($prestudent_id); @@ -446,8 +734,10 @@ class InfoCenter extends Auth_Controller if (hasData($lastStatus) && hasData($statusgrresult)) { - //check if still Interessent and not freigegeben yet - if ($lastStatus->retval[0]->status_kurzbz === self::INTERESSENTSTATUS && !isset($lastStatus->retval[0]->bestaetigtam)) + //check if still Interessent + if ($lastStatus->retval[0]->status_kurzbz === self::INTERESSENTSTATUS + || $lastStatus->retval[0]->status_kurzbz === self::BEWERBERSTATUS + || $lastStatus->retval[0]->status_kurzbz === self::WARTENDER) { $result = $this->PrestudentstatusModel->insert( array( @@ -744,6 +1034,13 @@ class InfoCenter extends Auth_Controller $this->load->view('system/infocenter/logs.php', array('logs' => $logs)); } + public function reloadDoks($person_id) + { + $dokumente_nachgereicht = $this->AkteModel->getAktenWithDokInfo($person_id, null, true); + + $this->load->view('system/infocenter/dokNachzureichend.php', array('dokumente_nachgereicht' => $dokumente_nachgereicht->retval)); + } + /** * Outputs content of an Akte, sends appropriate headers (so the document can be downloaded) * @param $akte_id @@ -898,6 +1195,117 @@ class InfoCenter extends Auth_Controller $this->outputJsonSuccess('success'); } + public function saveDocTyp($person_id) + { + $akte_id = $this->input->post('akte_id'); + $typ = $this->input->post('typ'); + + if (!isset($akte_id) || !isset($typ) || !isset($person_id)) + $this->terminateWithJsonError("Nicht alle sind Parameter übergeben worden"); + + $akte = $this->AkteModel->load($akte_id); + + if (!hasData($akte)) + $this->terminateWithJsonError("Fehler beim Laden der Akte"); + + $result = $this->AkteModel->update($akte_id, array('dokument_kurzbz' => $typ)); + + if (!isSuccess($result)) + $this->terminateWithJsonError("Fehler beim Update aufgetreten"); + + $dokument = $this->DokumentModel->load($akte->retval[0]->dokument_kurzbz); + + if (!hasData($dokument)) + $this->terminateWithJsonError("Fehler beim Laden des Dokumententypes"); + + $this->_log( + $person_id, + 'updatedoctyp', + array( + isEmptyString($akte->retval[0]->titel) ? $akte->retval[0]->bezeichnung : $akte->retval[0]->titel, + isEmptyString($dokument->retval[0]->bezeichnung) ? $dokument->retval[0]->dokument_kurbz : $dokument->retval[0]->bezeichnung + ) + ); + + $this->outputJsonSuccess('success'); + } + + public function saveNachreichung($person_id) + { + $nachreichungAm = $this->input->post('nachreichungAm'); + $nachreichungAnmerkung = empty($this->input->post('nachreichungAnmerkung')) ? NULL : $this->input->post('nachreichungAnmerkung'); + $typ = $this->input->post('typ'); + + $allowedTypes = [ + 'VorlSpB2' => 'SprachB2', + 'ZgvBaPre' => 'zgv_bakk', + 'ZgvMaPre' => 'zgv_mast' + ]; + + if (!in_array($typ, array_keys($allowedTypes))) + $this->terminateWithJsonError($this->p->t('ui', 'fehlerBeimSpeichern')); + + if (empty($nachreichungAm)) + $this->terminateWithJsonError($this->p->t('infocenter', 'datumUngueltig')); + + if (!preg_match('/^\d{2}\.\d{2}\.(\d{2}|\d{4})$/ ', $nachreichungAm)) + { + $this->terminateWithJsonError($this->p->t('infocenter', 'datumUngueltig')); + } + else + { + $ds = explode('.', $nachreichungAm); + if (! checkdate($ds[1], $ds[0], $ds[2])) + { + $this->terminateWithJsonError($this->p->t('infocenter', 'datumUngueltig')); + } + } + + $nachreichungAm = (date_format(date_create($nachreichungAm), 'Y-m-d')); + + $today = date('Y-m-d H:i:s'); + + if($nachreichungAm < $today) + $this->terminateWithJsonError($this->p->t('infocenter', 'nachreichDatumNichtVergangenheit')); + + + $akte = $this->AkteModel->loadWhere(array('person_id' => $person_id, 'dokument_kurzbz' => $allowedTypes[$typ])); + + if (hasData($akte)) { + $akte = getData($akte)[0]; + $this->AkteModel->update( + $akte->akte_id, + array( + 'anmerkung' => $nachreichungAnmerkung, + 'updateamum' => $today, + 'updatevon' => get_uid(), + 'nachgereicht' => true, + 'nachgereicht_am' => $nachreichungAm + ) + ); + } + else + { + $this->AkteModel->insert( + array( + 'dokument_kurzbz' => $allowedTypes[$typ], + 'person_id' => $person_id, + 'erstelltam' => NULL, + 'gedruckt' => false, + 'anmerkung' => $nachreichungAnmerkung, + 'updateamum' => $today, + 'updatevon' => get_uid(), + 'insertamum' => $today, + 'insertvon' => get_uid(), + 'uid' => NULL, + 'nachgereicht' => true, + 'nachgereicht_am' => $nachreichungAm + ) + ); + } + + $this->outputJsonSuccess("Done!"); + } // ----------------------------------------------------------------------------------------------------------------- // Private methods @@ -1058,9 +1466,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); @@ -1073,6 +1481,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)) @@ -1358,6 +1768,8 @@ class InfoCenter extends Auth_Controller || isset($zgvpruefung->prestudentstatus->bestaetigtam) || $zgvpruefung->prestudentstatus->status_kurzbz != self::INTERESSENTSTATUS; + $zgvpruefung->abgewiesener = $zgvpruefung->prestudentstatus->status_kurzbz === self::ABGEWIESENERSTATUS; + //wether prestudent was freigegeben for RT/Stg $zgvpruefung->isRtFreigegeben = false; $zgvpruefung->isStgFreigegeben = false; @@ -1421,14 +1833,26 @@ 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); - $abwstatusgruende = $this->StatusgrundModel->loadWhere(array('status_kurzbz' => self::ABGEWIESENERSTATUS))->retval; - $intstatusgruende = $this->StatusgrundModel->loadWhere(array('status_kurzbz' => self::INTERESSENTSTATUS))->retval; + $abwstatusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval; + $intstatusgruende = $this->StatusgrundModel->getStatus(self::INTERESSENTSTATUS)->retval; $data = array ( 'zgvpruefungen' => $zgvpruefungen, @@ -1545,8 +1969,10 @@ class InfoCenter extends Auth_Controller $person_id = $prestudentdata->person_id; $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); + return array('person_id' => $person_id, 'studiengang_kurzbz' => $studiengang_kurzbz, 'studiengang_bezeichnung' => $studiengang_bezeichnung, 'studiengang_mail' => $studiengang_mail, 'studiengang_typ' => $studiengang_typ); } /** @@ -1687,4 +2113,45 @@ class InfoCenter extends Auth_Controller $this->loglib->logError('Studiengang has no mail for sending Freigabe mail'); } } + + public function getAbsageData() + { + $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); + + $statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval; + $studienSemester = $this->variablelib->getVar('infocenter_studiensemester'); + $studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(['b', 'm'], $studienSemester); + + $data = array ( + 'statusgruende' => $statusgruende, + 'studiengaenge' => $studiengaenge->retval + ); + + $this->outputJsonSuccess($data); + } + + public function saveAbsageForAll() + { + $statusgrund = $this->input->post('statusgrund'); + $studiengang = $this->input->post('studiengang'); + $personen = $this->input->post('personen'); + $studienSemester = $this->variablelib->getVar('infocenter_studiensemester'); + + if ($statusgrund === 'null' || $studiengang === 'null' || empty($personen)) + $this->terminateWithJsonError("Bitte Statusgrund, Studiengang und Personen auswählen."); + + foreach($personen as $person) + { + $prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester); + + if(!hasData($prestudent)) + continue; + + $prestudentData = getData($prestudent); + + $this->saveAbsage($prestudentData[0]->prestudent_id, $statusgrund); + } + + $this->outputJsonSuccess("Success"); + } } diff --git a/application/controllers/system/infocenter/ZGVUeberpruefung.php b/application/controllers/system/infocenter/ZGVUeberpruefung.php new file mode 100644 index 000000000..bb0c36b66 --- /dev/null +++ b/application/controllers/system/infocenter/ZGVUeberpruefung.php @@ -0,0 +1,55 @@ + '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(); + $this->loadPhrases( + array( + 'infocenter' + ) + ); + } + + public function index() + { + $this->load->view('system/infocenter/infocenterZgvUeberpruefung.php'); + } + + 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/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/CL/Messages_model.php b/application/models/CL/Messages_model.php index 9ffd12cf6..4975af382 100644 --- a/application/models/CL/Messages_model.php +++ b/application/models/CL/Messages_model.php @@ -612,9 +612,9 @@ class Messages_model extends CI_Model if (!isEmptyString($vorlage_kurzbz)) { $this->load->model('system/Vorlagestudiengang_model', 'VorlagestudiengangModel'); - $this->VorlagestudiengangModel->addOrder('version','DESC'); + $this->VorlagestudiengangModel->addOrder('version', 'DESC'); - $getVorlage = $this->VorlagestudiengangModel->loadWhere(array('vorlage_kurzbz' => $vorlage_kurzbz)); + $getVorlage = $this->VorlagestudiengangModel->loadWhere(array('vorlage_kurzbz' => $vorlage_kurzbz, 'aktiv' => true)); } return $getVorlage; diff --git a/application/models/codex/Bisioaufenthaltfoerderung_model.php b/application/models/codex/Bisioaufenthaltfoerderung_model.php new file mode 100644 index 000000000..7a817d67c --- /dev/null +++ b/application/models/codex/Bisioaufenthaltfoerderung_model.php @@ -0,0 +1,15 @@ +dbTable = 'bis.tbl_bisio_aufenthaltfoerderung'; + $this->pk = array('bisio_id', 'aufenthaltfoerderung_code'); + $this->hasSequence = false; + } +} diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php index 2e014800c..52ba4d9f3 100644 --- a/application/models/crm/Prestudent_model.php +++ b/application/models/crm/Prestudent_model.php @@ -581,4 +581,19 @@ class Prestudent_model extends DB_Model return $this->execQuery($query, array($person_id)); } + + public function getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester) + { + $query = "SELECT ps.prestudent_id + FROM public.tbl_prestudentstatus pss + JOIN public.tbl_prestudent ps USING(prestudent_id) + JOIN public.tbl_studiengang sg USING(studiengang_kz) + JOIN lehre.tbl_studienplan sp USING(studienplan_id) + WHERE ps.person_id = ? + AND UPPER((sg.typ || sg.kurzbz) || ':' || sp.orgform_kurzbz) = ? + AND pss.studiensemester_kurzbz = ? + "; + + return $this->execQuery($query, array($person, $studiengang, $studienSemester)); + } } diff --git a/application/models/crm/Statusgrund_model.php b/application/models/crm/Statusgrund_model.php index 4717a7571..7ab17a45b 100644 --- a/application/models/crm/Statusgrund_model.php +++ b/application/models/crm/Statusgrund_model.php @@ -11,4 +11,18 @@ class Statusgrund_model extends DB_Model $this->dbTable = "public.tbl_status_grund"; $this->pk = "statusgrund_id"; } + + public function getStatus($status_kurzbz = null, $aktiv = null) + { + $this->addOrder('bezeichnung_mehrsprachig'); + $where = array(); + if (!is_null($status_kurzbz)) + $where['status_kurzbz'] = $status_kurzbz; + if (!is_null($aktiv)) + $where['aktiv'] = $aktiv; + + $status = $this->loadWhere($where); + + return success($status->retval); + } } diff --git a/application/models/crm/ZGVPruefungStatus_model.php b/application/models/crm/ZGVPruefungStatus_model.php new file mode 100644 index 000000000..5c51e45d8 --- /dev/null +++ b/application/models/crm/ZGVPruefungStatus_model.php @@ -0,0 +1,50 @@ +dbTable = 'public.tbl_zgvpruefungstatus_status'; + $this->pk = 'zgv_pruefung_status_id'; + $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/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/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index 8b8be0366..41bdabd11 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -481,4 +481,18 @@ class Studiengang_model extends DB_Model return $this->loadWhere($condition); } + + public function getStudiengaengeWithOrgForm($typ, $semester) + { + $query = "SELECT DISTINCT (UPPER(sg.typ || sg.kurzbz || ':' || sp.orgform_kurzbz)) AS Studiengang + FROM public.tbl_studiengang sg + JOIN lehre.tbl_studienordnung USING (studiengang_kz) + JOIN lehre.tbl_studienplan sp USING (studienordnung_id) + JOIN lehre.tbl_studienplan_semester spsem USING (studienplan_id) + WHERE sp.aktiv = TRUE AND sg.aktiv = TRUE AND sg.typ IN ? + AND spsem.studiensemester_kurzbz = ? + ORDER BY Studiengang"; + + return $this->execQuery($query, array($typ, $semester)); + } } 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/models/system/Variablenname_model.php b/application/models/system/Variablenname_model.php index 7b2a2cf88..869a03275 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_variablenname LIMIT 1' ); /** diff --git a/application/views/lehre/lehrauftrag/acceptLehrauftrag.php b/application/views/lehre/lehrauftrag/acceptLehrauftrag.php index e87f0945c..521883452 100644 --- a/application/views/lehre/lehrauftrag/acceptLehrauftrag.php +++ b/application/views/lehre/lehrauftrag/acceptLehrauftrag.php @@ -189,7 +189,7 @@ $this->load->view(
- + diff --git a/application/views/lehre/pruefungsprotokollUebersicht.php b/application/views/lehre/pruefungsprotokollUebersicht.php index 35bea7963..c7de8fcd0 100644 --- a/application/views/lehre/pruefungsprotokollUebersicht.php +++ b/application/views/lehre/pruefungsprotokollUebersicht.php @@ -48,6 +48,8 @@ name="period" value="today">p->t('ui','heute'); ?> +
diff --git a/application/views/lehre/pruefungsprotokollUebersichtData.php b/application/views/lehre/pruefungsprotokollUebersichtData.php index dd247c2eb..ff2caa774 100644 --- a/application/views/lehre/pruefungsprotokollUebersichtData.php +++ b/application/views/lehre/pruefungsprotokollUebersichtData.php @@ -19,9 +19,10 @@ FROM WHERE vorsitz='".$UID."' AND ( - '". $PERIOD. "' = 'today' AND datum = NOW()::date OR - '". $PERIOD. "' = 'lastWeek' AND datum = (NOW() - interval '1 week')::date OR - '". $PERIOD. "' = 'all' AND datum >= '2020-05-27' + ('". $PERIOD. "' = 'today' AND datum = NOW()::date) OR + ('". $PERIOD. "' = 'lastWeek' AND datum >= (NOW() - interval '1 week')::date AND datum < NOW()::date) OR + ('". $PERIOD. "' = 'upcoming' AND datum > NOW()::date) OR + ('". $PERIOD. "' = 'all' AND datum >= '2020-05-27') ) ORDER BY datum, nachname, vorname "; diff --git a/application/views/system/infocenter/absageModal.php b/application/views/system/infocenter/absageModal.php new file mode 100644 index 000000000..00298945e --- /dev/null +++ b/application/views/system/infocenter/absageModal.php @@ -0,0 +1,35 @@ + \ No newline at end of file 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) ?> diff --git a/application/views/system/infocenter/dokNachzureichend.php b/application/views/system/infocenter/dokNachzureichend.php new file mode 100644 index 000000000..7a3b3aa03 --- /dev/null +++ b/application/views/system/infocenter/dokNachzureichend.php @@ -0,0 +1,32 @@ + 0): ?> +
+

p->t('infocenter','nachzureichendeDokumente')) ?>

+ + + + + + + + + + + + + + + + + + + +
p->t('global','typ')) ?>p->t('infocenter','nachzureichenAm')) ?>p->t('infocenter','ausstellungsnation')) ?>p->t('global','anmerkung')) ?>
dokument_bezeichnung ?> + nachgereicht_am) ? date_format(date_create($dokument->nachgereicht_am), 'd.m.Y') : ''; ?> + + langtext ?> + + anmerkung; ?> +
+ \ No newline at end of file diff --git a/application/views/system/infocenter/dokpruefung.php b/application/views/system/infocenter/dokpruefung.php index 7c431fc46..95e383569 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')) . "" + ?> @@ -18,50 +21,59 @@ titel) ? $dokument->bezeichnung : $dokument->titel ?> - 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') : ''; ?> + + + -
- 0): ?> -
-

p->t('infocenter','nachzureichendeDokumente')) ?>

- - - - - - - - - - - - - - - - - - - -
p->t('global','typ')) ?>p->t('infocenter','nachzureichenAm')) ?>p->t('infocenter','ausstellungsnation')) ?>p->t('global','anmerkung')) ?>
dokument_bezeichnung ?> - nachgereicht_am) ? date_format(date_create($dokument->nachgereicht_am), 'd.m.Y') : ''; ?> - - langtext ?> - - anmerkung; ?> -
- + \ No newline at end of file diff --git a/application/views/system/infocenter/infocenter.php b/application/views/system/infocenter/infocenter.php index 4005518a1..38e644846 100644 --- a/application/views/system/infocenter/infocenter.php +++ b/application/views/system/infocenter/infocenter.php @@ -13,6 +13,7 @@ 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, + 'dialoglib' => true, 'phrases' => array( 'person' => array('vorname', 'nachname'), 'global' => array('mailAnXversandt'), @@ -40,6 +41,7 @@
load->view('system/infocenter/infocenterData.php'); ?> + load->view('system/infocenter/absageModal.php'); ?>
diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 0c7030059..4dd897f7f 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').'\''; @@ -213,7 +214,31 @@ 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 ps.zgvmanation + FROM public.tbl_prestudent ps + WHERE ps.person_id = p.person_id + ORDER BY ps.zgvmanation DESC NULLS LAST, ps.prestudent_id DESC + LIMIT 1 + ) AS "ZGVMNation", + ( + 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 +323,9 @@ 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 BA', + 'ZGV Nation MA', + 'InfoCenter Mitarbeiter' ), 'formatRow' => function($datasetRaw) { @@ -380,6 +407,20 @@ $datasetRaw->{'ZGVNation'} = '-'; } + if ($datasetRaw->{'ZGVMNation'} == null) + { + $datasetRaw->{'ZGVMNation'} = '-'; + } + + 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..30acb8617 100644 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -25,7 +25,9 @@ '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', + 'public/js/infocenter/docUeberpruefung.js' ), 'phrases' => array( 'infocenter' => array( @@ -43,7 +45,13 @@ 'nichtsZumEntfernen', 'fehlerBeimEntfernen', 'rueckstelldatumUeberschritten', - 'parkenZurueckstellenInfo' + 'parkenZurueckstellenInfo', + 'zgvInPruefung', + 'zgvErfuellt', + 'zgvNichtErfuellt', + 'zgvErfuelltPruefung', + 'datumUngueltig', + 'nachreichDatumNichtVergangenheit' ), 'ui' => array( 'gespeichert', @@ -121,6 +129,9 @@
load->view('system/infocenter/dokpruefung.php'); ?> +
+ load->view('system/infocenter/dokNachzureichend.php'); ?> +
diff --git a/application/views/system/infocenter/infocenterFreigegeben.php b/application/views/system/infocenter/infocenterFreigegeben.php index 15e73f1b6..4855e5cd6 100644 --- a/application/views/system/infocenter/infocenterFreigegeben.php +++ b/application/views/system/infocenter/infocenterFreigegeben.php @@ -13,6 +13,7 @@ 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, + 'dialoglib' => true, 'phrases' => array( 'person' => array('vorname', 'nachname'), 'global' => array('mailAnXversandt'), @@ -40,6 +41,7 @@
load->view('system/infocenter/infocenterFreigegebenData.php'); ?> + load->view('system/infocenter/absageModal.php'); ?>
diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index aab69b651..26c30d718 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').'\''; @@ -114,6 +115,12 @@ sg.studiengang_kz in('.$ADDITIONAL_STG.') ) AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' + AND NOT EXISTS ( + SELECT 1 + FROM tbl_prestudentstatus spss + WHERE spss.prestudent_id = ps.prestudent_id + AND spss.status_kurzbz = '.$REJECTED_STATUS.' + ) LIMIT 1 ) AS "StgAbgeschickt", ( @@ -210,7 +217,31 @@ 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 ps.zgvmanation + FROM public.tbl_prestudent ps + WHERE ps.person_id = p.person_id + ORDER BY ps.zgvmanation DESC NULLS LAST, ps.prestudent_id DESC + LIMIT 1 + ) AS "ZGVMNation", + ( + 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, @@ -278,7 +309,9 @@ 'Reihungstest angetreten', 'Reihungstest angemeldet', 'Reihungstest date', - 'ZGV Nation' + 'ZGV Nation BA', + 'ZGV Nation MA', + 'InfoCenter Mitarbeiter' ), 'formatRow' => function($datasetRaw) { @@ -371,6 +404,21 @@ { $datasetRaw->{'ZGVNation'} = '-'; } + + if ($datasetRaw->{'ZGVMNation'} == null) + { + $datasetRaw->{'ZGVMNation'} = '-'; + } + + if ($datasetRaw->{'InfoCenterMitarbeiter'} === 'InfoCenter') + { + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Ja'; + } + else + { + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Nein'; + } + return $datasetRaw; }, 'markRow' => function($datasetRaw) { diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviert.php b/application/views/system/infocenter/infocenterReihungstestAbsolviert.php index 79f75885b..f2d838fac 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviert.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviert.php @@ -13,6 +13,7 @@ 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, + 'dialoglib' => true, 'phrases' => array( 'person' => array('vorname', 'nachname'), 'global' => array('mailAnXversandt'), @@ -40,6 +41,7 @@
load->view('system/infocenter/infocenterReihungstestAbsolviertData.php'); ?> + load->view('system/infocenter/absageModal.php'); ?>
diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php index 22b122bb0..81ddd2594 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 = ' @@ -83,10 +84,11 @@ LIMIT 1 ) AS "AnzahlAbgeschickt", ( - SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(sg.typ || sg.kurzbz || \':\' || sg.orgform_kurzbz)), \', \') + SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(sg.typ || sg.kurzbz || \':\' || sp.orgform_kurzbz)), \', \') FROM public.tbl_prestudentstatus pss JOIN public.tbl_prestudent ps USING(prestudent_id) JOIN public.tbl_studiengang sg USING(studiengang_kz) + JOIN lehre.tbl_studienplan sp USING(studienplan_id) WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND pss.bewerbung_abgeschicktamum IS NOT NULL AND ps.person_id = p.person_id @@ -166,7 +168,31 @@ 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 ps.zgvmanation + FROM public.tbl_prestudent ps + WHERE ps.person_id = p.person_id + ORDER BY ps.zgvmanation DESC NULLS LAST, ps.prestudent_id DESC + LIMIT 1 + ) AS "ZGVMNation", + ( + 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, @@ -225,7 +251,9 @@ 'Reihungstest angetreten', 'Reihungstest angemeldet', 'Reihungstest Datum', - 'ZGV Nation' + 'ZGV Nation BA', + 'ZGV Nation MA', + 'InfoCenter Mitarbeiter' ), 'formatRow' => function($datasetRaw) { @@ -313,6 +341,21 @@ { $datasetRaw->{'ZGVNation'} = '-'; } + + if ($datasetRaw->{'ZGVMNation'} == null) + { + $datasetRaw->{'ZGVMNation'} = '-'; + } + + if ($datasetRaw->{'InfoCenterMitarbeiter'} === 'InfoCenter') + { + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Ja'; + } + else + { + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Nein'; + } + return $datasetRaw; }, 'markRow' => function($datasetRaw) { diff --git a/application/views/system/infocenter/infocenterZgvDetails.php b/application/views/system/infocenter/infocenterZgvDetails.php new file mode 100644 index 000000000..62fefbec8 --- /dev/null +++ b/application/views/system/infocenter/infocenterZgvDetails.php @@ -0,0 +1,245 @@ +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', + 'public/js/infocenter/zgvUeberpruefung.js' + ), + 'phrases' => array( + 'infocenter' => array( + 'notizHinzufuegen', + 'notizAendern', + 'nichtsZumEntfernen', + 'fehlerBeimEntfernen', + 'zgvInPruefung', + 'zgvErfuellt', + 'zgvNichtErfuellt', + 'zgvErfuelltPruefung' + ), + '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)); ?> +
+ load->view('system/infocenter/dokNachzureichend.php'); ?> +
+
+ +
+ + + + + + + +
+
+
+
+
+
+ +
+
+
+
+
+
+ +

+ 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..6614e6b2a --- /dev/null +++ b/application/views/system/infocenter/infocenterZgvUeberpruefungData.php @@ -0,0 +1,75 @@ +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", + 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 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' => 'lehre/zgvpruefung', + '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'] : '') + ); + + 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; + }, +); + +echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray); +?> diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index 41b549616..05c94c384 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,22 +303,31 @@ 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) ); ?> + + statusZGV))) ?: print_r('data-info="need"')?>> + +
-
+
+ + statusZGV))) ?: print_r('data-info="need"')?>> +
-
+
@@ -344,7 +355,7 @@ prestudentstatus->status_kurzbz) && in_array($zgvpruefung->prestudentstatus->status_kurzbz, ['Bewerber', 'Wartender']))) : ?>
- prestudentstatus->bewerbung_abgeschicktamum)) - { - $disabled = $disabledStg = 'disabled'; - $disabledTxt = $disabledStgTxt = $this->p->t('infocenter', 'bewerbungMussAbgeschickt'); - } + prestudentstatus->bewerbung_abgeschicktamum)) + { + $disabled = $disabledStg = 'disabled'; + $disabledTxt = $disabledStgTxt = $this->p->t('infocenter', 'bewerbungMussAbgeschickt'); + } - if ($studiengangtyp !== 'b') - { - $disabled = 'disabled'; - $disabledTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); + if ($studiengangtyp !== 'b' && $studiengangtyp !== 'm') + { + $disabled = 'disabled'; + $disabledTxt = $this->p->t('infocenter', 'nurBachelorMasterFreigeben'); - // FIT-Lehrgänge: exceptions, can be freigegeben in Infocenter - if (!in_array($studiengang_kz, $fit_programme_studiengaenge)) - { - $disabledStg = 'disabled'; - $disabledStgTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); - } + // FIT-Lehrgänge: exceptions, can be freigegeben in Infocenter + if (!in_array($studiengang_kz, $fit_programme_studiengaenge)) + { + $disabledStg = 'disabled'; + $disabledStgTxt = $this->p->t('infocenter', 'nurBachelorMasterFreigeben'); } - ?> + } + if (!$infoonly) : + ?>
- - + +
+
prestudentstatus->status_kurzbz) && $zgvpruefung->prestudentstatus->status_kurzbz === 'Interessent'): ?> @@ -508,9 +486,66 @@
+
+
+
+ + + + +
+
+
- + + + -
Powered by FH Complete
+
Powered by FH Complete


diff --git a/cis/index_login.php b/cis/index_login.php index 4c4d75f93..74c87f649 100644 --- a/cis/index_login.php +++ b/cis/index_login.php @@ -69,7 +69,7 @@ if(isset($_GET['login'])) -
Powered by FH Complete
+
Powered by FH Complete


diff --git a/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php b/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php index 713b93dc5..407502178 100644 --- a/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php +++ b/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php @@ -12,10 +12,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * Authors: Christian Paminger , + * + * Authors: + * Christian Paminger , * Andreas Oesterreicher and * Rudolf Hangl < rudolf.hangl@technikum-wien.at > * Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at > + * Manuela Thamer */ require_once ('../../../../config/cis.config.inc.php'); require_once ('../../../../config/global.config.inc.php'); @@ -306,6 +309,8 @@ foreach ($noten_obj->result as $row) { if(typeof(typ)=='undefined') typ = 'Termin2'; + var nn = document.getElementById(uid+"_nn").innerHTML; + var vn = document.getElementById(uid+"_vn").innerHTML; var str = "
"; str += ""; @@ -314,7 +319,7 @@ foreach ($noten_obj->result as $row) anlegendiv.style.top = y+"px"; var x = getOffset('x'); x = x+300; anlegendiv.style.left = x+"px"; - str += ""; + str += ""; str += ""; str += " - - '; + + '; // Bereits eingetragene Note ermitteln if ($lvgesamtnote = new lvgesamtnote($lvid, $uid, $stsem)) diff --git a/cis/private/profile/index.php b/cis/private/profile/index.php index dd39cf301..80062a932 100644 --- a/cis/private/profile/index.php +++ b/cis/private/profile/index.php @@ -44,6 +44,7 @@ require_once('../../../include/addon.class.php'); require_once('../../../include/gruppe.class.php'); require_once('../../../include/adresse.class.php'); require_once('../../../include/benutzerberechtigung.class.php'); +require_once('../../../include/bisverwendung.class.php'); $sprache = getSprache(); $p = new phrasen($sprache); @@ -271,6 +272,22 @@ if (!$ansicht) } +if (!$ansicht) +{ + if ($is_employee) + { + $verwendung = new bisverwendung(); + if($verwendung->getLastVerwendung($uid)) + { + if (!$verwendung->hauptberuflich) + { + echo 'Hauptberuf: '. $verwendung->hauptberuf; + } + } + echo "

"; + } +} + if (!$ansicht) { $adresse = new adresse(); diff --git a/cis/private/profile/urlaubsfreigabe.php b/cis/private/profile/urlaubsfreigabe.php index 251e1ee3e..f71d7adda 100644 --- a/cis/private/profile/urlaubsfreigabe.php +++ b/cis/private/profile/urlaubsfreigabe.php @@ -18,6 +18,7 @@ * Authors: Christian Paminger , * Andreas Oesterreicher , * Rudolf Hangl and + * Manuela Thamer */ require_once('../../../config/cis.config.inc.php'); require_once('../../../include/functions.inc.php'); @@ -28,6 +29,13 @@ require_once('../../../include/benutzer.class.php'); require_once('../../../include/mitarbeiter.class.php'); require_once('../../../include/benutzerberechtigung.class.php'); require_once('../../../include/addon.class.php'); +require_once('../../../include/mail.class.php'); +require_once('../../../include/phrasen.class.php'); +require_once('../../../include/globals.inc.php'); +require_once('../../../include/sprache.class.php'); + +$sprache = getSprache(); +$p = new phrasen($sprache); if (!$db = new basis_db()) die('Fehler beim Oeffnen der Datenbankverbindung'); @@ -43,16 +51,16 @@ else { //Bis August das aktuelle Jahr anzeigen //Ab September das naechste - if(date('m')<9) + if (date('m') < 9) $year = date('Y'); else - $year = date('Y')+1; + $year = date('Y') + 1; } -if(isset($_GET['uid'])) - $uid=$_GET['uid']; +if (isset($_GET['uid'])) + $uid = $_GET['uid']; else - $uid=''; + $uid = ''; $datum_obj = new datum(); @@ -98,50 +106,74 @@ echo ' $mitarbeiter = new mitarbeiter(); $mitarbeiter->getUntergebene($user); -if(count($mitarbeiter->untergebene)==0 && !$rechte->isBerechtigt('admin') && !$rechte->isBerechtigt('mitarbeiter/urlaube', null, 'suid')) +if (count($mitarbeiter->untergebene) == 0 && !$rechte->isBerechtigt('admin') && !$rechte->isBerechtigt('mitarbeiter/urlaube', null, 'suid')) die('Es sind Ihnen keine Mitarbeiter zugeteilt für die sie den Urlaub freigeben dürfen'); $untergebene = ''; foreach ($mitarbeiter->untergebene as $row) { - if($untergebene!='') - $untergebene.=','; + if ($untergebene != '') + $untergebene .= ','; $untergebene .= $db->db_add_param($row); } -if($rechte->isBerechtigt('admin') || $rechte->isBerechtigt('mitarbeiter/urlaube', null, 'suid')) +if ($rechte->isBerechtigt('admin') || $rechte->isBerechtigt('mitarbeiter/urlaube', null, 'suid')) { - if($untergebene!='') - $untergebene.=','; + if ($untergebene != '') + $untergebene .= ','; $untergebene .= $db->db_add_param($uid); } $qry = "SELECT * FROM public.tbl_person JOIN public.tbl_benutzer USING(person_id) WHERE uid in($untergebene)"; $mitarbeiter = array(); -if($result = $db->db_query($qry)) +if ($result = $db->db_query($qry)) { - while($row = $db->db_fetch_object($result)) + while ($row = $db->db_fetch_object($result)) { - $mitarbeiter[$row->uid]['vorname']=$row->vorname; - $mitarbeiter[$row->uid]['nachname']=$row->nachname; - $mitarbeiter[$row->uid]['titelpre']=$row->titelpre; - $mitarbeiter[$row->uid]['titelpost']=$row->titelpost; + $mitarbeiter[$row->uid]['vorname'] = $row->vorname; + $mitarbeiter[$row->uid]['nachname'] = $row->nachname; + $mitarbeiter[$row->uid]['titelpre'] = $row->titelpre; + $mitarbeiter[$row->uid]['titelpost'] = $row->titelpost; } } -if($uid!='' && !isset($mitarbeiter[$uid]) && $uid!=$user && !$rechte->isBerechtigt('admin')) +if ($uid != '' && !isset($mitarbeiter[$uid]) && $uid != $user && !$rechte->isBerechtigt('admin')) die('Sie haben keine Berechtigung fuer diesen Mitarbeiter'); //Freigeben eines Urlaubes -if(isset($_GET['action']) && $_GET['action']=='freigabe') +if (isset($_GET['action']) && $_GET['action'] == 'freigabe') { $zeitsperre = new zeitsperre(); - if($zeitsperre->load($_GET['id'])) + if ($zeitsperre->load($_GET['id'])) { - if(isset($mitarbeiter[$zeitsperre->mitarbeiter_uid])) + if (isset($mitarbeiter[$zeitsperre->mitarbeiter_uid])) { $zeitsperre->freigabeamum = date('Y-m-d H:i:s'); $zeitsperre->freigabevon = $user; - if(!$zeitsperre->save(false)) + if (!$zeitsperre->save(false)) + { echo "Fehler bei der Freigabe: $zeitsperre->errormsg"; + } + + //Bestätigungsmail an Mitarbeiter*in + $to = $zeitsperre->mitarbeiter_uid. '@'.DOMAIN; + $person = new person(); + $fullNameVG = $person->getFullNameFromBenutzer($user); + $fullNameMA = $person->getFullNameFromBenutzer($zeitsperre->mitarbeiter_uid); + $from = 'noreply@'.DOMAIN; + $subject = $p->t('urlaubstool/urlaubsfreigabe'). date("d.m.Y", strtotime($zeitsperre->vondatum)). " ". + $p->t('urlaubstool/bis'). " ". date("d.m.Y", strtotime($zeitsperre->bisdatum)); + $text = $p->t('urlaubstool/diesIstEineAutomatischeMail')."\n"; + $text .= $p->t('urlaubstool/urlaubVon')." ".date("d.m.Y", strtotime($zeitsperre->vondatum))." ". + $p->t('urlaubstool/bis')." ".date("d.m.Y", strtotime($zeitsperre->bisdatum)); + $text .= $p->t('urlaubstool/urlaubBis', array($fullNameVG)); + $text .= "\n". "\n". $p->t('urlaubstool/sieKoennenDiesenUnterFolgenderAdresseEinsehen'); + $text .= "\n". APP_ROOT. 'cis/private/profile/urlaubstool.php'; + + $mail = new mail($to, $from, $subject, $text); + + if ($mail->send()) + { + echo "".$p->t('urlaubstool/bestaetigungsmailWurdeVersandt', array($fullNameMA)).""; + } } else { @@ -152,40 +184,38 @@ if(isset($_GET['action']) && $_GET['action']=='freigabe') { echo 'Die Zeitsperre konnte nicht geladen werden'; } - } -//Monat zeichenen +//Monat zeichnen function draw_monat($monat) { global $untergebene, $mitarbeiter, $year, $datum_obj, $uid; - if (!$db = new basis_db()) - die('Fehler beim Oeffnen der Datenbankverbindung'); - + if (!$db = new basis_db()) + die('Fehler beim Oeffnen der Datenbankverbindung'); echo '"; - echo ""; + if($rechte->isBerechtigt('student/stammdaten', null, 's') || $rechte->isBerechtigt('mitarbeiter/stammdaten', null, 's')) + echo ""; echo "isBerechtigt('mitarbeiter/zeitwuensche', null, 'suid')) + $readonly = ''; + + for ($j=1; $j<7; $j++) { echo ''; for ($i=0;$i<$num_rows_stunde;$i++) @@ -166,7 +172,7 @@ $updatevon = 0; if ($index=="") $index=1; $bgcolor=$cfgStdBgcolor[$index+3]; - echo ''; + echo ''; } echo ''; } @@ -189,7 +195,10 @@ $updatevon = 0;

- + isBerechtigt('mitarbeiter/zeitwuensche', null, 'suid')) + echo '' + ?>

diff --git a/vilesci/stammdaten/personen_wartung.php b/vilesci/stammdaten/personen_wartung.php index c143a1390..2c4c4f0fa 100644 --- a/vilesci/stammdaten/personen_wartung.php +++ b/vilesci/stammdaten/personen_wartung.php @@ -135,6 +135,99 @@ if (isset($personToDelete) && isset($personToKeep) && $personToDelete >= 0 && $p } else { + // Prüfen, ob tbl_alma existiert (also ob ALMA extension installiert ist) + if($result = @$db->db_query("SELECT 1 FROM sync.tbl_alma LIMIT 1")) + { + // Wenn Person in ALMA Bibliothek vorkommt, ggf. die Person dort übernehmen + $alma_has_personToKeep = false; + $alma_has_personToDelete = false; + $alma_update_obj = new StdClass(); + $alma_query_upd = ''; + + $alma_query = " + SELECT * + FROM sync.tbl_alma + WHERE ( + person_id = " . $db->db_add_param($personToKeep, FHC_INTEGER) . " OR + person_id = " . $db->db_add_param($personToDelete, FHC_INTEGER) . " + )"; + + if ($result = $db->db_query($alma_query)) + { + while ($row = $db->db_fetch_object($result)) + { + if ($row->person_id == $personToKeep) + { + $alma_has_personToKeep = true; + } + if ($row->person_id == $personToDelete) + { + $alma_has_personToDelete = true; + $alma_update_obj = $row; + } + } + } + + // Falls nur die zu löschende Person in ALMA vorhanden ist, mit der zu behaltenden Person ersetzen + if ($alma_has_personToDelete && !$alma_has_personToKeep) + { + $alma_query_upd = " + UPDATE sync.tbl_alma + SET person_id = " . $db->db_add_param($personToKeep, FHC_INTEGER) . " + WHERE alma_match_id = " . $alma_update_obj->alma_match_id . " + AND person_id = " . $alma_update_obj->person_id . ";"; + } + // Falls bereits doppelte Einträge in ALMA vorhanden sind (zu löschende und zu behaltende), manuell lösen + elseif ($alma_has_personToDelete && $alma_has_personToKeep) + { + die('Es sind bereits beide Personen in ALMA vorhanden. Bitte zuerst direkt im ALMA Bibliotheksystem und in der tbl_alma lösen.'); + } + } + + // Prüfen, ob tbl_sap_students exisitiert + if($result = @$db->db_query("SELECT 1 FROM sync.tbl_sap_students LIMIT 1")) + { + // Wenn Person in SAP students vorkommt, ggf. die Person dort übernehmen + $sap_students_has_personToKeep = false; + $sap_students_has_personToDelete = false; + $sap_students_update_obj = new StdClass(); + $sap_students_query_upd = ''; + + $sap_students_query = " + SELECT * + FROM sync.tbl_sap_students + WHERE ( + person_id = " . $db->db_add_param($personToKeep, FHC_INTEGER) . " OR + person_id = " . $db->db_add_param($personToDelete, FHC_INTEGER) . " + )"; + + if ($result = $db->db_query($sap_students_query)) { + while ($row = $db->db_fetch_object($result)) { + if ($row->person_id == $personToKeep) { + $sap_students_has_personToKeep = true; + } + if ($row->person_id == $personToDelete) { + $sap_students_has_personToDelete = true; + $sap_students_update_obj = $row; + } + } + } + + // Wenn die zu löschende Person in SAP students eingetragen ist, dann mit der zu behaltenden Person überschreiben + if ($sap_students_has_personToDelete && !$sap_students_has_personToKeep) { + $sap_students_query_upd = " + UPDATE sync.tbl_sap_students + SET person_id = " . $db->db_add_param($personToKeep, FHC_INTEGER) . " + WHERE sap_user_id = " . $db->db_add_param($sap_students_update_obj->sap_user_id, FHC_STRING) . " + AND person_id = " . $sap_students_update_obj->person_id . ";"; + } + // Wenn doppelte Personeneinträge in SAP students vorhanden sind (zu löschende UND zu behaltende Person), + // dann manuell lösen + elseif ($sap_students_has_personToDelete && $sap_students_has_personToKeep) { + die('Es sind bereits beide Personen in SAP vorhanden. Bitte zuerst direkt in der tbl_sap_students lösen.'); + } + } + $personToDelete_obj = new person(); if ($personToDelete_obj->load($personToDelete)) { @@ -346,6 +439,8 @@ if (isset($personToDelete) && isset($personToKeep) && $personToDelete >= 0 && $p $sql_query_upd1 .= "UPDATE system.tbl_person_lock SET person_id=" . $db->db_add_param($personToKeep, FHC_INTEGER) . " WHERE person_id=" . $db->db_add_param($personToDelete, FHC_INTEGER) . ";"; $sql_query_upd1 .= "UPDATE wawi.tbl_betriebsmittelperson SET person_id=" . $db->db_add_param($personToKeep, FHC_INTEGER) . " WHERE person_id=" . $db->db_add_param($personToDelete, FHC_INTEGER) . ";"; $sql_query_upd1 .= "UPDATE wawi.tbl_konto SET person_id=" . $db->db_add_param($personToKeep, FHC_INTEGER) . " WHERE person_id=" . $db->db_add_param($personToDelete, FHC_INTEGER) . ";"; + $sql_query_upd1 .= $alma_query_upd; + $sql_query_upd1 .= $sap_students_query_upd; $sql_query_upd1 .= "DELETE FROM public.tbl_person WHERE person_id=" . $db->db_add_param($personToDelete, FHC_INTEGER) . ";";
X
t('benotungstool/pruefungAnlegenFuer');?> "+uid+":
t('benotungstool/pruefungAnlegenFuer');?> "+nn+" "+vn+":
t('global/datum');?>:"; str += ""; @@ -1166,8 +1171,8 @@ if (defined("CIS_GESAMTNOTE_PRUEFUNG_MOODLE_LE_NOTE") && CIS_GESAMTNOTE_PRUEFUNG $htmlstring .= '
' . $db->convert_html_chars($uid) . '' . $db->convert_html_chars($data['nachname']) . '' . $db->convert_html_chars($data['vorname']) . '' . $db->convert_html_chars($data['nachname']) . '' . $db->convert_html_chars($data['vorname']) . ''; echo '
'; - echo date('F',mktime(0,0,0,$monat,1,date('Y'))); - echo " ".($monat>8?$year-1:$year); + echo date('F', mktime(0,0,0,$monat,1,date('Y'))); + echo " ".($monat > 8?$year-1:$year); echo '
'; //Alle Anzeigen bei denen das von- oder bisdatum in dieses monat fallen $qry = "SELECT * FROM campus.tbl_zeitsperre WHERE zeitsperretyp_kurzbz='Urlaub' AND ( - (date_part('month', vondatum)='$monat' AND date_part('year', vondatum)='".($monat>8?$year-1:$year)."') + (date_part('month', vondatum)='$monat' AND date_part('year', vondatum)='".($monat > 8?$year - 1:$year)."') OR - (date_part('month', bisdatum)='$monat' AND date_part('year', bisdatum)='".($monat>8?$year-1:$year)."') + (date_part('month', bisdatum)='$monat' AND date_part('year', bisdatum)='".($monat > 8?$year - 1:$year)."') )"; - if($uid=='') - $qry.=" AND mitarbeiter_uid in($untergebene)"; + if($uid == '') + $qry.= " AND mitarbeiter_uid in($untergebene)"; else - $qry.=" AND mitarbeiter_uid=".$db->db_add_param($uid); + $qry.= " AND mitarbeiter_uid=". $db->db_add_param($uid); $qry.="ORDER BY vondatum, mitarbeiter_uid"; - if($result = $db->db_query($qry)) + if ($result = $db->db_query($qry)) { - while($row = $db->db_fetch_object($result)) + while ($row = $db->db_fetch_object($result)) { $vertretung = new benutzer($row->vertretung_uid); $freigabe=''; @@ -207,7 +237,7 @@ function draw_monat($monat) } //Jahr mit Pfeilen zum blaettern anzeigen -if($uid!='') +if ($uid!='') { echo '"; @@ -232,16 +262,16 @@ echo '
'; //Tabelle mit den Monaten ausgeben echo '
'; echo "Alle Mitarbeiter anzeigen
'; $monat=9; -for($i=0;$i<12;$i++) +for($i = 0;$i < 12;$i++) { - if($i%3==0) + if ($i%3 == 0) { echo ''; } draw_monat($monat); $monat++; - if($monat>12) - $monat=1; + if ($monat > 12) + $monat = 1; } echo '
diff --git a/cms/dms.php b/cms/dms.php index aa79ab0c3..d6ee5be58 100644 --- a/cms/dms.php +++ b/cms/dms.php @@ -85,6 +85,7 @@ if($doc->isLocked($id)) $dokumente_arr[] .= 'ZgvBaPre'; $dokumente_arr[] .= 'ZgvMaPre'; $dokumente_arr[] .= 'InvitLet'; + $dokumente_arr[] .= 'VorlSpB2'; $dokumente_arr[] .= 'ZeitBest'; } if ($person_id!=$akte_person || !in_array($akte_dokument_kurzbz, $dokumente_arr)) diff --git a/cms/menu.inc.php b/cms/menu.inc.php index 136187f70..7375ee849 100644 --- a/cms/menu.inc.php +++ b/cms/menu.inc.php @@ -19,7 +19,7 @@ */ /** * Dieses File enthaelt Hilfsklassen zur Anzeige des CMS-Menues - * + * * mit drawSubmenu($id) wird das enstprechende Menue gezeichnet. */ require_once(dirname(__FILE__).'/../include/functions.inc.php'); @@ -30,13 +30,14 @@ $params = array(); foreach($_REQUEST as $key=>$value) $params[$key]=$value; +$user = null; //Parameter fuer Include Addons $includeparams = array(); $contentobjects=array(); $chldsobject = array(); /** * Zeichnet einen Menueeintrag aus dem CMS System - * + * * @param $content_id */ function drawSubmenu($content_id) @@ -47,16 +48,16 @@ function drawSubmenu($content_id) global $contentobjects; $content = new content(); $sprache = getSprache(); - + // Daten Laden - + // Alle Kindelemente des Contents holen $ids = $content->getAllChilds($content_id); - // Alle vorkommenden Contenteintraege laden + // Alle vorkommenden Contenteintraege laden $content->loadArray($ids, $sprache, true); $contentobjects = $content->result; - + // Baumstruktur laden $childsobject = $content->getChildArray($content_id); @@ -91,7 +92,7 @@ function drawSubmenu1($content_id) drawEntry($contentobj); } } - + } } @@ -101,12 +102,13 @@ function drawSubmenu1($content_id) */ function drawEntry($item) { - global $childsobject; + global $childsobject, $user; //pruefen ob der Content eine Berechtigung erfordert if($item->locked) { - $user = get_uid(); + if(is_null($user)) + $user = get_uid(); $content = new content(); //wenn der User nicht berechtigt ist, dann wird der Eintrag nicht angezeigt if(!$content->berechtigt($item->content_id, $user)) @@ -139,7 +141,7 @@ function drawEntry($item) Redirect($item); else DrawLink(APP_ROOT.'cms/content.php?content_id='.$item->content_id,'content',$item->titel); - + echo ""; } } @@ -155,7 +157,7 @@ function DrawLink($link, $target, $name, $content_id=null, $open=null) { if($target=='') $target='content'; - + if($open) $class='class="selected"'; else @@ -167,7 +169,7 @@ function DrawLink($link, $target, $name, $content_id=null, $open=null) * Redirects sind Links Seiten ausserhalb des CMS * die URL kann Variablen enthalten. Diese werden hier ersetzt. * Danach wird der Link angezeigt. - * + * * @param $content_id ContentID des Redirects * @param $name Anzeigename des Links * @param $content_id_Submenu ID des Submenues das geoeffnet werden soll (optional) @@ -175,42 +177,42 @@ function DrawLink($link, $target, $name, $content_id=null, $open=null) function Redirect($content, $content_id_Submenu=null) { global $sprache, $params; - + $xml = new DOMDocument(); if($content->content!='') { $xml->loadXML($content->content); } - + if($xml->getElementsByTagName('url')->item(0)) $url = $xml->getElementsByTagName('url')->item(0)->nodeValue; else $url=''; - + //Variablen Ersetzen foreach($params as $key=>$value) { $url = str_replace('$'.$key,addslashes($value),$url); } - + if($xml->getElementsByTagName('target')->item(0)) $target = $xml->getElementsByTagName('target')->item(0)->nodeValue; else $target=''; - + DrawLink($url, $target, $content->titel, $content_id_Submenu, $content->menu_open); } /** - * Bei Content mit Include Templates wird + * Bei Content mit Include Templates wird * das entsprechende Menu-Addon geladen und inkludiert - * + * * @param $content_id */ function IncludeMenuAddon($content) { global $sprache, $includeparams; - + $xml = new DOMDocument(); if($content->content!='') { @@ -223,6 +225,6 @@ function IncludeMenuAddon($content) if($url!='') { $includeparams['content']=$content; - include(dirname(__FILE__).'/menu/'.$url); + include(dirname(__FILE__).'/menu/'.$url); } } diff --git a/content/fasoverlay.js.php b/content/fasoverlay.js.php index f7a30158f..9504285ce 100644 --- a/content/fasoverlay.js.php +++ b/content/fasoverlay.js.php @@ -1539,7 +1539,7 @@ function OpenAboutDialog() // **** function OpenManual() { - window.open('https://wiki.fhcomplete.org/doku.php?','_blank'); + window.open('https://wiki.fhcomplete.info/','_blank'); } // **** diff --git a/content/mitarbeiter/mitarbeiterDBDML.php b/content/mitarbeiter/mitarbeiterDBDML.php index 6bb1513d0..eb7ba6650 100644 --- a/content/mitarbeiter/mitarbeiterDBDML.php +++ b/content/mitarbeiter/mitarbeiterDBDML.php @@ -174,7 +174,13 @@ if(!$error) elseif($_POST['zeitaufzeichnungspflichtig']=='false') $verwendung->zeitaufzeichnungspflichtig = false; else - $verwendung->zeitaufzeichnungspflichtig = ''; + $verwendung->azgrelevant = ''; + if($_POST['azgrelevant']=='true') + $verwendung->azgrelevant = true; + elseif($_POST['azgrelevant']=='false') + $verwendung->azgrelevant = false; + else + $verwendung->azgrelevant = ''; if($verwendung->save()) { diff --git a/content/mitarbeiter/mitarbeiteroverlay.js.php b/content/mitarbeiter/mitarbeiteroverlay.js.php index 3495ce3c3..d4d2aae9a 100644 --- a/content/mitarbeiter/mitarbeiteroverlay.js.php +++ b/content/mitarbeiter/mitarbeiteroverlay.js.php @@ -1233,6 +1233,7 @@ function MitarbeiterVerwendungSpeichern(dialog, bisverwendung_id, mitarbeiter_ui dv_art = dialog.getElementById('mitarbeiter-verwendung-detail-textbox-dv_art').value; inkludierte_lehre = dialog.getElementById('mitarbeiter-verwendung-detail-textbox-inkludierte_lehre').value; zeitaufzeichnungspflichtig = dialog.getElementById('mitarbeiter-verwendung-detail-checkbox-zeitaufzeichnungspflichtig').checked; + azgrelevant = dialog.getElementById('mitarbeiter-verwendung-detail-checkbox-azgrelevant').checked; if(verwendung_code=='1') { @@ -1291,6 +1292,7 @@ function MitarbeiterVerwendungSpeichern(dialog, bisverwendung_id, mitarbeiter_ui req.add('dv_art', dv_art); req.add('inkludierte_lehre', inkludierte_lehre); req.add('zeitaufzeichnungspflichtig', zeitaufzeichnungspflichtig); + req.add('azgrelevant', azgrelevant); var response = req.executePOST(); diff --git a/content/mitarbeiter/mitarbeiterverwendungdialog.js.php b/content/mitarbeiter/mitarbeiterverwendungdialog.js.php index 841f167e9..1119c468d 100644 --- a/content/mitarbeiter/mitarbeiterverwendungdialog.js.php +++ b/content/mitarbeiter/mitarbeiterverwendungdialog.js.php @@ -70,6 +70,7 @@ function MitarbeiterVerwendungInit(mitarbeiter_uid, bisverwendung_id) dv_art = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#dv_art" )); inkludierte_lehre = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#inkludierte_lehre" )); zeitaufzeichnungspflichtig = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#zeitaufzeichnungspflichtig" )); + azgrelevant = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#azgrelevant" )); } else { @@ -87,7 +88,7 @@ function MitarbeiterVerwendungInit(mitarbeiter_uid, bisverwendung_id) var predicateNS = "http://www.technikum-wien.at/mitarbeiter/rdf"; fixangestellt = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#fixangestellt" )); - + azgrelevant = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#azgrelevant" )); //neuer Datensatz wird angelegt MitarbeiterVerwendungDetailNeu='true'; @@ -112,6 +113,14 @@ function MitarbeiterVerwendungInit(mitarbeiter_uid, bisverwendung_id) { zeitaufzeichnungspflichtig='Nein'; } + if (!azgrelevant) + { + azgrelevant='Nein'; + } + else + { + azgrelevant='Ja'; + } } document.getElementById('mitarbeiter-verwendung-detail-menulist-beschart1').value=ba1code; @@ -138,7 +147,10 @@ function MitarbeiterVerwendungInit(mitarbeiter_uid, bisverwendung_id) document.getElementById('mitarbeiter-verwendung-detail-checkbox-zeitaufzeichnungspflichtig').checked=true; else document.getElementById('mitarbeiter-verwendung-detail-checkbox-zeitaufzeichnungspflichtig').checked=false; - + if(azgrelevant=='Nein') + document.getElementById('mitarbeiter-verwendung-detail-checkbox-azgrelevant').checked=false; + else + document.getElementById('mitarbeiter-verwendung-detail-checkbox-azgrelevant').checked=true; MitarbeiterVerwendungDetailToggleHauptberuf(); MitarbeiterVerwendungVerwendungChange(); } diff --git a/content/mitarbeiter/mitarbeiterverwendungdialog.xul.php b/content/mitarbeiter/mitarbeiterverwendungdialog.xul.php index bc87a097d..197df7d27 100644 --- a/content/mitarbeiter/mitarbeiterverwendungdialog.xul.php +++ b/content/mitarbeiter/mitarbeiterverwendungdialog.xul.php @@ -167,6 +167,10 @@ echo ' + + diff --git a/content/tempus.js.php b/content/tempus.js.php index e4dad5e43..5a734ebf3 100644 --- a/content/tempus.js.php +++ b/content/tempus.js.php @@ -473,7 +473,7 @@ function SyncLVPlan() // **** function OpenManualTempus() { - window.open('https://wiki.fhcomplete.org/doku.php?id=tempus:allgemeines','Manual'); + window.open('https://wiki.fhcomplete.info/doku.php?id=tempus:allgemeines','Manual'); } // **** diff --git a/include/bisverwendung.class.php b/include/bisverwendung.class.php index 799cfc93e..598edcac1 100644 --- a/include/bisverwendung.class.php +++ b/include/bisverwendung.class.php @@ -47,6 +47,7 @@ class bisverwendung extends basis_db public $dv_art; public $inkludierte_lehre; public $zeitaufzeichnungspflichtig; + public $azgrelevant; public $ba1bez; public $ba2bez; @@ -122,6 +123,7 @@ class bisverwendung extends basis_db $this->dv_art = $row->dv_art; $this->inkludierte_lehre = $row->inkludierte_lehre; $this->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig); + $this->azgrelevant = $this->db_parse_bool($row->azgrelevant); return true; } else @@ -247,13 +249,21 @@ class bisverwendung extends basis_db { $zeitaufzeichnungspflichtig = 'null'; } + if(is_bool($this->azgrelevant)) + { + $azgrelevant = $this->db_add_param($this->azgrelevant, FHC_BOOLEAN); + } + else + { + $azgrelevant = 'null'; + } if($new) { //Neuen Datensatz anlegen $qry = "BEGIN;INSERT INTO bis.tbl_bisverwendung (ba1code, ba2code, beschausmasscode, verwendung_code, mitarbeiter_uid, hauptberufcode, hauptberuflich, habilitation, beginn, ende, vertragsstunden, - updateamum, updatevon, insertamum, insertvon, dv_art, inkludierte_lehre, zeitaufzeichnungspflichtig) VALUES (". + updateamum, updatevon, insertamum, insertvon, dv_art, inkludierte_lehre, zeitaufzeichnungspflichtig, azgrelevant) VALUES (". $this->db_add_param($this->ba1code, FHC_INTEGER).', '. $this->db_add_param($this->ba2code, FHC_INTEGER).', '. $this->db_add_param($this->beschausmasscode, FHC_INTEGER).', '. @@ -271,7 +281,8 @@ class bisverwendung extends basis_db $this->db_add_param($this->insertvon).', '. $this->db_add_param($this->dv_art).','. $this->db_add_param($this->inkludierte_lehre).','. - $zeitaufzeichnungspflichtig. ');'; + $zeitaufzeichnungspflichtig.','. + $azgrelevant. ');'; } else @@ -295,7 +306,8 @@ class bisverwendung extends basis_db " insertvon=".$this->db_add_param($this->insertvon).",". " dv_art=".$this->db_add_param($this->dv_art).",". " inkludierte_lehre=".$this->db_add_param($this->inkludierte_lehre).",". - " zeitaufzeichnungspflichtig=". $zeitaufzeichnungspflichtig. + " zeitaufzeichnungspflichtig=". $zeitaufzeichnungspflichtig.",". + " azgrelevant =". $azgrelevant. " WHERE bisverwendung_id=".$this->db_add_param($this->bisverwendung_id, FHC_INTEGER); } @@ -388,7 +400,7 @@ class bisverwendung extends basis_db $obj->dv_art = $row->dv_art; $obj->inkludierte_lehre = $row->inkludierte_lehre; $obj->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig); - + $obj->azgrelevant = $this->db_parse_bool($row->azgrelevant); $this->result[] = $obj; } return true; @@ -445,6 +457,7 @@ class bisverwendung extends basis_db $obj->dv_art = $row->dv_art; $obj->inkludierte_lehre = $row->inkludierte_lehre; $obj->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig); + $obj->azgrelevant = $this->db_parse_bool($row->azgrelevant); $this->result[] = $obj; } @@ -503,6 +516,7 @@ class bisverwendung extends basis_db $obj->dv_art = $row->dv_art; $obj->inkludierte_lehre = $row->inkludierte_lehre; $obj->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig); + $obj->azgrelevant = $this->db_parse_bool($row->azgrelevant); $this->result[] = $obj; } @@ -524,12 +538,13 @@ class bisverwendung extends basis_db { //laden des Datensatzes $qry = "SELECT - * + *, tbl_hauptberuf.bezeichnung as hauptberuf FROM bis.tbl_bisverwendung + LEFT JOIN bis.tbl_hauptberuf USING(hauptberufcode) WHERE mitarbeiter_uid=".$this->db_add_param($uid)." - ORDER BY ende DESC NULLS LAST,beginn DESC NULLS LAST LIMIT 1;"; + ORDER BY ende DESC NULLS FIRST,beginn DESC NULLS LAST LIMIT 1;"; if($this->db_query($qry)) { @@ -543,6 +558,7 @@ class bisverwendung extends basis_db $this->mitarbeiter_uid = $row->mitarbeiter_uid; $this->hauptberufcode = $row->hauptberufcode; $this->hauptberuflich = $this->db_parse_bool($row->hauptberuflich); + $this->hauptberuf = $row->hauptberuf; $this->habilitation = $this->db_parse_bool($row->habilitation); $this->beginn = $row->beginn; $this->ende = $row->ende; @@ -554,6 +570,7 @@ class bisverwendung extends basis_db $this->dv_art = $row->dv_art; $this->inkludierte_lehre = $row->inkludierte_lehre; $this->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig); + $this->azgrelevant = $this->db_parse_bool($row->azgrelevant); } return true; } @@ -582,7 +599,7 @@ class bisverwendung extends basis_db (beginn<=now() OR beginn IS NULL) AND (ende>=now() OR ende IS NULL) - ORDER BY ende DESC NULLS LAST,beginn DESC NULLS LAST LIMIT 1;"; + ORDER BY ende DESC NULLS FIRST,beginn DESC NULLS LAST LIMIT 1;"; if($this->db_query($qry)) { @@ -607,6 +624,7 @@ class bisverwendung extends basis_db $this->dv_art = $row->dv_art; $this->inkludierte_lehre = $row->inkludierte_lehre; $this->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig); + $this->azgrelevant = $this->db_parse_bool($row->azgrelevant); } return true; } @@ -669,6 +687,7 @@ class bisverwendung extends basis_db $obj->dv_art = $row->dv_art; $obj->inkludierte_lehre = $row->inkludierte_lehre; $obj->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig); + $obj->azgrelevant = $this->db_parse_bool($row->azgrelevant); $this->result[] = $obj; } @@ -797,5 +816,35 @@ class bisverwendung extends basis_db return false; } } + + public function inZeitaufzeichnungspflichtigPeriod($PeriodStartDate, $PeriodEndDate) + { + $PeriodStartDateISO = date('Y-m-d', strtotime($PeriodStartDate)); + $PeriodEndDateISO = date('Y-m-d', strtotime($PeriodEndDate)); + + $beginn = date('Y-m-d', strtotime($this->beginn)); + $end = date('Y-m-d', strtotime($this->ende)); + $zp = $this->zeitaufzeichnungspflichtig; + + if ($zp) + { + if ( + (($PeriodStartDateISO >= $beginn) && (($PeriodStartDateISO <= $end) || is_null($this->ende))) + || + (($PeriodEndDateISO >= $beginn) && (($PeriodEndDateISO <= $end) || is_null($this->ende))) + ) + { + return true; + } + else + { + return false; + } + } + else + { + return false; + } + } } ?> diff --git a/include/dokument.class.php b/include/dokument.class.php index a2eab0e68..6dec9a66d 100644 --- a/include/dokument.class.php +++ b/include/dokument.class.php @@ -1,5 +1,5 @@ db_add_param($prestudent_id, FHC_INTEGER); - + if(!$archivdokumente) { $qry.=" AND (tbl_vorlage.archivierbar = FALSE OR tbl_vorlage.archivierbar IS NULL)"; @@ -401,7 +401,7 @@ class dokument extends basis_db } $qry = "SELECT tbl_dokument.* , tbl_dokumentstudiengang.* - FROM public.tbl_dokument + FROM public.tbl_dokument JOIN public.tbl_dokumentstudiengang USING(dokument_kurzbz) LEFT JOIN public.tbl_vorlage ON (tbl_dokument.dokument_kurzbz = tbl_vorlage.vorlage_kurzbz) WHERE studiengang_kz=".$this->db_add_param($studiengang_kz, FHC_INTEGER); @@ -836,11 +836,11 @@ class dokument extends basis_db return false; } } - + /** * Liefert die Studiengänge bei denen das übergebene Dokument benötigt wird * @param string $dokument_kurzbz Kurzbz des Dokuments - * @param integer $person_id Optional. Die Dokumente werden zusätzlich auf die Studiengänge eingeschränkt für die sich eine Person beworben hat. + * @param integer $person_id Optional. Die Dokumente werden zusätzlich auf die Studiengänge eingeschränkt für die sich eine Person beworben hat. * @return object Objekt mit den Studiengängen oder false. */ public function getStudiengaengeDokument($dokument_kurzbz, $person_id = null) @@ -854,7 +854,7 @@ class dokument extends basis_db AND person_id =".$this->db_add_param($person_id, FHC_INTEGER)." AND tbl_prestudentstatus.status_kurzbz = 'Interessent' AND get_rolle_prestudent (prestudent_id, NULL) NOT IN ('Abgewiesener','Abbrecher') - + ORDER BY kuerzel"; if($result = $this->db_query($qry)) @@ -869,12 +869,12 @@ class dokument extends basis_db $stg_obj->studiengang_kz = $row->studiengang_kz; $stg_obj->english = $row->english; $stg_obj->stufe = $row->stufe; - + $this->result[] = $stg_obj; } return $stg_obj; } - else + else return false; } else @@ -882,6 +882,138 @@ class dokument extends basis_db $this->errormsg="Fehler bei der Abfrage aufgetreten"; return false; } + } + /** + * Akzeptiert ein bestimmtes Dokument + * @param char $dokument_kurzbz Bezeichner Dokument. + * @param int $person_id Personenkennzeichen. + * @return boolean true wenn akzeptiert bzw geprüft ohne Akzeptieren, false wenn Fehler + */ + public function akzeptiereDokument($dokument_kurzbz, $person_id) + { + $db = new basis_db(); + $arrayDoksZuAkzeptieren = array(); + + //get Prestudent_ids + $qry = "SELECT + prestudent_id + FROM + tbl_prestudent ps, tbl_studiengang sg + WHERE + ps.studiengang_kz = sg.studiengang_kz + AND sg.typ = 'm' + AND person_id = ".$this->db_add_param($person_id)." + AND not exists( + SELECT * + from tbl_dokumentprestudent dok + where dok.prestudent_id = ps.prestudent_id + and dokument_kurzbz = ".$this->db_add_param($dokument_kurzbz).")"; + + //gibt ein Array von zu akzeptierenden Dokumenten zurück + if ($db->db_query($qry)) + { + $num_rows = $db->db_num_rows(); + + if ($num_rows > 0) + { + while ($row = $db->db_fetch_object()) + { + $arrayDoksZuAkzeptieren[] = $row->prestudent_id; + } + + //für alle prestudent_ids das Dokument akzeptieren + $qry = "INSERT INTO public.tbl_dokumentprestudent(dokument_kurzbz, prestudent_id) VALUES"; + + foreach ($arrayDoksZuAkzeptieren as $prestudent_id) + { + $qry .= "(".$this->db_add_param($dokument_kurzbz). ",". $prestudent_id. ")"; + + if (next($arrayDoksZuAkzeptieren) == true) + { + $qry .= ","; + } + } + $qry .= ";"; + + if ($this->db_query($qry)) + { + return true; + } + else + { + $this->errormsg = 'Fehler beim Akzeptieren'; + return false; + } + } + return true; + } + + else + return false; + } + + /** + * entakzeptiert ein bestimmtes Dokument + * @param char $dokument_kurzbz Kurzbezeichnung des zu entakzeptierenden Dokuments. + * @param int $person_id Personenkennzeichen. + * @return boolean true wenn entakzeptiert bzw geprüft ohne Entakzeptieren, false wenn Fehler + */ + public function entakzeptiereDokument($dokument_kurzbz, $person_id) + { + $db = new basis_db(); + $arrayDoksZuEntakzeptieren = array(); + + //get Prestudent_ids + $qry = "SELECT + prestudent_id + from + tbl_dokumentprestudent + join + tbl_prestudent using (prestudent_id) + where + person_id = ".$this->db_add_param($person_id)." + and dokument_kurzbz = ".$this->db_add_param($dokument_kurzbz); + + //gibt ein Array von zu Entakzeptierenden Dokumenten zurück + if ($db->db_query($qry)) + { + $num_rows = $db->db_num_rows(); + + if ($num_rows > 0) + { + while ($row = $db->db_fetch_object()) + { + $arrayDoksZuEntakzeptieren[] = $row->prestudent_id; + } + + //für alle prestudent_ids das Dokument Entakzeptieren + $qry = "DELETE FROM public.tbl_dokumentprestudent WHERE prestudent_id in ("; + + foreach ($arrayDoksZuEntakzeptieren as $prestudent_id) + { + $qry .= $prestudent_id; + + if (next($arrayDoksZuEntakzeptieren) == true) + { + $qry .= ","; + } + } + $qry .= ") AND dokument_kurzbz = ".$this->db_add_param($dokument_kurzbz).";"; + + if ($this->db_query($qry)) + { + return true; + } + else + { + $this->errormsg = 'Fehler beim Entakzeptieren'; + return false; + } + } + return true; + } + else + return false; } } diff --git a/include/notiz.class.php b/include/notiz.class.php index 459bdc6a6..5d237e2b8 100644 --- a/include/notiz.class.php +++ b/include/notiz.class.php @@ -1,618 +1,619 @@ - and - */ -require_once(dirname(__FILE__).'/basis_db.class.php'); -require_once(dirname(__FILE__).'/dms.class.php'); - -class notiz extends basis_db -{ - public $new; - public $result=array(); - public $dokumente=array(); - - //Tabellenspalten - public $notiz_id; - public $titel; - public $text; - public $verfasser_uid; - public $bearbeiter_uid; - public $start; - public $ende; - public $erledigt; - public $insertamum; - public $insertvon; - public $updateamum; - public $updatevon; - - public $projekt_kurzbz; - public $projektphase_id; - public $projekttask_id; - public $uid; - public $person_id; - public $prestudent_id; - public $bestellung_id; - public $lehreinheit_id; - public $anrechnung_id; - - /** - * Konstruktor - * @param $notiz_id - */ - public function __construct($notiz_id = null) - { - parent::__construct(); - - if($notiz_id != null) - $this->load($notiz_id); - } - - /** - * Laedt eine Notiz - * @param $notiz_id - * @return true wenn ok, false im Fehlerfall - */ - public function load($notiz_id) - { - if(!is_numeric($notiz_id)) - { - $this->errormsg = 'NotizID ist ungueltig'; - return false; - } - - $qry = "SELECT * FROM public.tbl_notiz WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); - - if($this->db_query($qry)) - { - if($row = $this->db_fetch_object()) - { - $this->notiz_id=$row->notiz_id; - $this->titel=$row->titel; - $this->text=$row->text; - $this->verfasser_uid=$row->verfasser_uid; - $this->bearbeiter_uid=$row->bearbeiter_uid; - $this->start=$row->start; - $this->ende=$row->ende; - $this->erledigt=$this->db_parse_bool($row->erledigt); - $this->insertamum=$row->insertamum; - $this->insertvon=$row->insertvon; - $this->updateamum=$row->updateamum; - $this->updatevon=$row->updatevon; - $this->getDokumente($row->notiz_id); - - return true; - } - else - { - $this->errormsg = 'Datensatz wurde nicht gefunden'; - return false; - } - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - /** - * Löscht eine Notiz - * @param $notiz_id - * @return true wenn ok, false im Fehlerfall - */ - public function delete($notiz_id) - { - if(!is_numeric($notiz_id)) - { - $this->errormsg = 'NotizID ist ungueltig'; - return false; - } - - // Dokumente der Notiz löschen - $this->getDokumente($notiz_id); - if(!empty($this->dokumente)) - { - $dms = new dms(); - - foreach($this->dokumente as $dms_id) - { - $dms->deleteDms($dms_id); - } - } - - $qry = "Delete FROM public.tbl_notiz WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); - - if(!$this->db_query($qry)) - { - $this->errormsg = 'Fehler beim Loeschen der Daten'; - return false; - } - return true; - } - - /** - * Prueft die Daten vor dem Speichern - * auf Gueltigkeit - */ - public function validate() - { - return true; - } - - /** - * Speichert den aktuellen Datensatz in die Datenbank - * Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt - * andernfalls wird der Datensatz mit der ID in $notiz_id aktualisiert - * @return true wenn ok, false im Fehlerfall - */ - public function save($new=null) - { - if($new==null) - $new=$this->new; - - if(!$this->validate()) - return false; - - if($new) - { - //Neuen Datensatz einfuegen - $qry='BEGIN;INSERT INTO public.tbl_notiz (titel, text, verfasser_uid, - bearbeiter_uid, start, ende, erledigt, insertamum, insertvon, - updateamum, updatevon) VALUES('. - $this->db_add_param($this->titel).', '. - $this->db_add_param($this->text).', '. - $this->db_add_param($this->verfasser_uid).','. - $this->db_add_param($this->bearbeiter_uid).','. - $this->db_add_param($this->start).','. - $this->db_add_param($this->ende).','. - $this->db_add_param($this->erledigt,FHC_BOOLEAN).','. - $this->db_add_param($this->insertamum).','. - $this->db_add_param($this->insertvon).','. - $this->db_add_param($this->updateamum).','. - $this->db_add_param($this->updatevon).');'; - } - else - { - $qry='UPDATE public.tbl_notiz SET '. - 'titel='.$this->db_add_param($this->titel).', '. - 'text='.$this->db_add_param($this->text).', '. - 'verfasser_uid='.$this->db_add_param($this->verfasser_uid).', '. - 'bearbeiter_uid='.$this->db_add_param($this->bearbeiter_uid).', '. - 'start='.$this->db_add_param($this->start).', '. - 'ende='.$this->db_add_param($this->ende).', '. - 'erledigt='.$this->db_add_param($this->erledigt,FHC_BOOLEAN).', '. - 'updateamum='.$this->db_add_param($this->updateamum).', '. - 'updatevon='.$this->db_add_param($this->updatevon).' '. - 'WHERE notiz_id='.$this->db_add_param($this->notiz_id,FHC_INTEGER).';'; - } - - if($this->db_query($qry)) - { - if($new) - { - $qry="SELECT currval('seq_notiz_notiz_id') as id;"; - if($result = $this->db_query($qry)) - { - if($row = $this->db_fetch_object($result)) - { - $this->notiz_id = $row->id; - $this->db_query('COMMIT;'); - return true; - } - else - { - $this->errormsg = 'Fehler beim Lesen der Sequence'; - $this->db_query('ROLLBACK'); - return false; - } - } - else - { - $this->errormsg = 'Fehler beim Lesen der Sequence'; - $this->db_query('ROLLBACK'); - return false; - } - } - return true; - } - else - { - $this->errormsg = 'Fehler beim Speichern des Datensatzes'; - return false; - } - } - - /** - * Speichert die Zuordnung einer Notiz - * - */ - public function saveZuordnung() - { - $qry = "INSERT INTO public.tbl_notizzuordnung(notiz_id, projekt_kurzbz, projektphase_id, projekttask_id, - uid, person_id, prestudent_id, bestellung_id, lehreinheit_id, anrechnung_id) VALUES(". - $this->db_add_param($this->notiz_id, FHC_INTEGER).','. - $this->db_add_param($this->projekt_kurzbz).','. - $this->db_add_param($this->projektphase_id, FHC_INTEGER).','. - $this->db_add_param($this->projekttask_id, FHC_INTEGER).','. - $this->db_add_param($this->uid).','. - $this->db_add_param($this->person_id, FHC_INTEGER).','. - $this->db_add_param($this->prestudent_id, FHC_INTEGER).','. - $this->db_add_param($this->bestellung_id, FHC_INTEGER).','. - $this->db_add_param($this->lehreinheit_id, FHC_INTEGER).','. - $this->db_add_param($this->anrechnung_id, FHC_INTEGER).');'; - - if($this->db_query($qry)) - { - return true; - } - else - { - $this->errormsg = 'Fehler beim Speichern der Daten'; - return false; - } - } - - /** - * Speichert ein Dokument zur Notiz - * @param int $dms_id - * @return boolean - */ - public function saveDokument($dms_id) - { - $qry = "INSERT INTO public.tbl_notiz_dokument(notiz_id, dms_id) VALUES(". - $this->db_add_param($this->notiz_id, FHC_INTEGER).','. - $this->db_add_param($dms_id, FHC_INTEGER).');'; - - if($this->db_query($qry)) - { - return true; - } - else - { - $this->errormsg = 'Fehler beim Speichern der Daten'; - return false; - } - } - - /** - * - * Laedt die Notizen - * @param $erledigt - * @param $projekt_kurzbz - * @param $projektphase_id - * @param $projekttask_id - * @param $uid - * @param $person_id - * @param $prestudent_id - * @param $bestellung_id - * @param $user - * @param $lehreinheit_id - * @param $anrechnung_id - * @return boolean - */ - public function getNotiz( - $erledigt=null, - $projekt_kurzbz=null, - $projektphase_id=null, - $projekttask_id=null, - $uid=null, - $person_id=null, - $prestudent_id=null, - $bestellung_id=null, - $user=null, - $lehreinheit_id=null, - $stundenplandev_id=null, - $anrechnung_id=null, - $titel=null) - { - $qry = "SELECT - * - FROM - public.tbl_notiz - LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) - WHERE 1=1"; - - if(!is_null($erledigt)) - { - if($erledigt) - $qry.=" AND erledigt=true"; - else - $qry.=" AND erledigt=false"; - } - if($projekt_kurzbz!='') - $qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz); - if($projektphase_id!='') - $qry.=" AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER); - if($projekttask_id!='') - $qry.=" AND projekttask_id=".$this->db_add_param($projekttask_id, FHC_INTEGER); - if($uid!='') - $qry.=" AND uid=".$this->db_add_param($uid); - if($person_id!='') - $qry.=" AND person_id=".$this->db_add_param($person_id, FHC_INTEGER); - if($prestudent_id!='') - $qry.=" AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER); - if($bestellung_id!='') - $qry.=" AND bestellung_id=".$this->db_add_param($bestellung_id, FHC_INTEGER); - if($user!='') - $qry.=" AND (verfasser_uid=".$this->db_add_param($user)." OR bearbeiter_uid=".$this->db_add_param($user).")"; - if($lehreinheit_id!='') - $qry.=" AND lehreinheit_id=".$this->db_add_param($lehreinheit_id, FHC_INTEGER); - if($anrechnung_id!='') - $qry.=" AND anrechnung_id=".$this->db_add_param($anrechnung_id, FHC_INTEGER); - if($titel!='') - $qry.=" AND titel=".$this->db_add_param($titel); - - $qry.=' ORDER BY start, ende, titel'; - - if($result = $this->db_query($qry)) - { - while($row = $this->db_fetch_object($result)) - { - $obj = new notiz(); - - $obj->notiz_id=$row->notiz_id; - $obj->titel=$row->titel; - $obj->text=$row->text; - $obj->verfasser_uid=$row->verfasser_uid; - $obj->bearbeiter_uid=$row->bearbeiter_uid; - $obj->start=$row->start; - $obj->ende=$row->ende; - $obj->erledigt=$this->db_parse_bool($row->erledigt); - $obj->insertamum=$row->insertamum; - $obj->insertvon=$row->insertvon; - $obj->updateamum=$row->updateamum; - $obj->updatevon=$row->updatevon; - $obj->getDokumente($row->notiz_id); - - $this->result[] = $obj; - } - return true; - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - /** - * - * Laedt die Notizen vom Bewerbungstool - * @param integer $person_id - * @param integer $prestudent_id - * @return boolean - */ - public function getBewerbungstoolNotizen($person_id, $prestudent_id = null) - { - $qry = "SELECT - * - FROM - public.tbl_notiz - LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) - WHERE (insertvon = 'online' OR insertvon = 'online_notiz') - AND person_id = ".$this->db_add_param($person_id, FHC_INTEGER); - if ($prestudent_id != '') - { - $qry .= " AND prestudent_id = ".$this->db_add_param($prestudent_id, FHC_INTEGER); - } - - $qry .= " ORDER BY notiz_id"; - - if($result = $this->db_query($qry)) - { - while($row = $this->db_fetch_object($result)) - { - $obj = new notiz(); - - $obj->notiz_id=$row->notiz_id; - $obj->titel=$row->titel; - $obj->text=$row->text; - $obj->verfasser_uid=$row->verfasser_uid; - $obj->bearbeiter_uid=$row->bearbeiter_uid; - $obj->start=$row->start; - $obj->ende=$row->ende; - $obj->erledigt=$this->db_parse_bool($row->erledigt); - $obj->insertamum=$row->insertamum; - $obj->insertvon=$row->insertvon; - $obj->updateamum=$row->updateamum; - $obj->updatevon=$row->updatevon; - - $this->result[] = $obj; - } - return true; - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - - /** - * TEMPORARY: kurzfristig wird für das Onlinebewerbungstool die Ausbildung - * (Name und Adresse der besuchten Schule) in eine Notiz mit - * insertvon = online_ausbildung gespeichert. - * Wird auf UDF umgebaut! - * - * Laedt die Notizen zur Ausbilund vom Bewerbungstool - * @param $person_id int - * @return boolean - */ - public function getBewerbungstoolNotizenAusbildung($person_id) - { - $qry = 'SELECT - * - FROM - public.tbl_notiz - LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) - WHERE person_id = ' . $this->db_add_param($person_id, FHC_INTEGER) . - ' AND insertvon = ' . $this->db_add_param('online_ausbildung') . - ' ORDER BY notiz_id'; - - if($result = $this->db_query($qry)) - { - while($row = $this->db_fetch_object($result)) - { - $obj = new notiz(); - - $obj->notiz_id=$row->notiz_id; - $obj->titel=$row->titel; - $obj->text=$row->text; - $obj->verfasser_uid=$row->verfasser_uid; - $obj->bearbeiter_uid=$row->bearbeiter_uid; - $obj->start=$row->start; - $obj->ende=$row->ende; - $obj->erledigt=$this->db_parse_bool($row->erledigt); - $obj->insertamum=$row->insertamum; - $obj->insertvon=$row->insertvon; - $obj->updateamum=$row->updateamum; - $obj->updatevon=$row->updatevon; - - $this->result[] = $obj; - } - return true; - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - - - /** - - * - - * Laedt die Notizen - * @param $erledigt - * @param $projekt_kurzbz - * @param $projektphase_id - * @param $projekttask_id - * @param $uid - * @param $person_id - * @param $prestudent_id - * @param $bestellung_id - * @param $user - * @param $lehreinheit_id - * @param $anrechnung_id - * @return boolean - */ - public function getAnzahlNotizen($erledigt=null, $projekt_kurzbz=null, $projektphase_id=null, $projekttask_id=null, $uid=null, $person_id=null, $prestudent_id=null, $bestellung_id=null, $user=null, $lehreinheit_id=null, $anrechnung_id=null) - { - $qry = "SELECT - count(*) as anzahl - FROM - public.tbl_notiz - LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) - WHERE 1=1"; - - if(!is_null($erledigt)) - { - if($erledigt) - $qry.=" AND erledigt=true"; - else - $qry.=" AND erledigt=false"; - } - if($projekt_kurzbz!='') - $qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz); - if($projektphase_id!='') - $qry.=" AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER); - if($projekttask_id!='') - $qry.=" AND projekttask_id=".$this->db_add_param($projekttask_id, FHC_INTEGER); - if($uid!='') - $qry.=" AND uid=".$this->db_add_param($uid); - if($person_id!='') - $qry.=" AND person_id=".$this->db_add_param($person_id, FHC_INTEGER); - if($prestudent_id!='') - $qry.=" AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER); - if($bestellung_id!='') - $qry.=" AND bestellung_id=".$this->db_add_param($bestellung_id, FHC_INTEGER); - if($user!='') - $qry.=" AND (verfasser_uid=".$this->db_add_param($user)." OR bearbeiter_uid=".$this->db_add_param($user).")"; - if($lehreinheit_id!='') - $qry.=" AND lehreinheit_id=".$this->db_add_param($lehreinheit_id, FHC_INTEGER); - if($anrechnung_id!='') - $qry.=" AND anrechnung_id=".$this->db_add_param($anrechnung_id, FHC_INTEGER); - - if($result = $this->db_query($qry)) - { - if($row = $this->db_fetch_object($result)) - return $row->anzahl; - else - { - $this->errormsg='Fehler beim Laden der Daten'; - return false; - } - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - /** - * Laedt die Dokumente der Notiz - * @return boolean - */ - public function getDokumente($notiz_id) - { - $qry = "SELECT dms_id FROM public.tbl_notiz_dokument WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); - - if($this->db_query($qry)) - { - while($row = $this->db_fetch_object()) - { - $this->dokumente[] = $row->dms_id; - } - - return true; - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - /** - * Prueft ob das Dokument an einer Notiz haengt - * @param $dms_id DMS id des Dokuments. - * @return boolean true wenn das Dokument an einer Notiz hängt, sonst false. - */ - public function isNotizDokument($dms_id) - { - $qry = "SELECT * FROM public.tbl_notiz_dokument WHERE dms_id=".$this->db_add_param($dms_id, FHC_INTEGER); - - if($result = $this->db_query($qry)) - { - if($this->db_num_rows($result)>0) - return true; - else - return false; - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } -} + and + */ +require_once(dirname(__FILE__).'/basis_db.class.php'); +require_once(dirname(__FILE__).'/dms.class.php'); + +class notiz extends basis_db +{ + public $new; + public $result=array(); + public $dokumente=array(); + + //Tabellenspalten + public $notiz_id; + public $titel; + public $text; + public $verfasser_uid; + public $bearbeiter_uid; + public $start; + public $ende; + public $erledigt; + public $insertamum; + public $insertvon; + public $updateamum; + public $updatevon; + + public $projekt_kurzbz; + public $projektphase_id; + public $projekttask_id; + public $uid; + public $person_id; + public $prestudent_id; + public $bestellung_id; + public $lehreinheit_id; + public $anrechnung_id; + + /** + * Konstruktor + * @param $notiz_id + */ + public function __construct($notiz_id = null) + { + parent::__construct(); + + if($notiz_id != null) + $this->load($notiz_id); + } + + /** + * Laedt eine Notiz + * @param $notiz_id + * @return true wenn ok, false im Fehlerfall + */ + public function load($notiz_id) + { + if(!is_numeric($notiz_id)) + { + $this->errormsg = 'NotizID ist ungueltig'; + return false; + } + + $qry = "SELECT * FROM public.tbl_notiz WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); + + if($this->db_query($qry)) + { + if($row = $this->db_fetch_object()) + { + $this->notiz_id=$row->notiz_id; + $this->titel=$row->titel; + $this->text=$row->text; + $this->verfasser_uid=$row->verfasser_uid; + $this->bearbeiter_uid=$row->bearbeiter_uid; + $this->start=$row->start; + $this->ende=$row->ende; + $this->erledigt=$this->db_parse_bool($row->erledigt); + $this->insertamum=$row->insertamum; + $this->insertvon=$row->insertvon; + $this->updateamum=$row->updateamum; + $this->updatevon=$row->updatevon; + $this->getDokumente($row->notiz_id); + + return true; + } + else + { + $this->errormsg = 'Datensatz wurde nicht gefunden'; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * Löscht eine Notiz + * @param $notiz_id + * @return true wenn ok, false im Fehlerfall + */ + public function delete($notiz_id) + { + if(!is_numeric($notiz_id)) + { + $this->errormsg = 'NotizID ist ungueltig'; + return false; + } + + // Dokumente der Notiz löschen + $this->getDokumente($notiz_id); + if(!empty($this->dokumente)) + { + $dms = new dms(); + + foreach($this->dokumente as $dms_id) + { + $dms->deleteDms($dms_id); + } + } + + $qry = "Delete FROM public.tbl_notiz WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); + + if(!$this->db_query($qry)) + { + $this->errormsg = 'Fehler beim Loeschen der Daten'; + return false; + } + return true; + } + + /** + * Prueft die Daten vor dem Speichern + * auf Gueltigkeit + */ + public function validate() + { + return true; + } + + /** + * Speichert den aktuellen Datensatz in die Datenbank + * Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt + * andernfalls wird der Datensatz mit der ID in $notiz_id aktualisiert + * @return true wenn ok, false im Fehlerfall + */ + public function save($new=null) + { + if($new==null) + $new=$this->new; + + if(!$this->validate()) + return false; + + if($new) + { + //Neuen Datensatz einfuegen + $qry='BEGIN;INSERT INTO public.tbl_notiz (titel, text, verfasser_uid, + bearbeiter_uid, start, ende, erledigt, insertamum, insertvon, + updateamum, updatevon) VALUES('. + $this->db_add_param($this->titel).', '. + $this->db_add_param($this->text).', '. + $this->db_add_param($this->verfasser_uid).','. + $this->db_add_param($this->bearbeiter_uid).','. + $this->db_add_param($this->start).','. + $this->db_add_param($this->ende).','. + $this->db_add_param($this->erledigt,FHC_BOOLEAN).','. + $this->db_add_param($this->insertamum).','. + $this->db_add_param($this->insertvon).','. + $this->db_add_param($this->updateamum).','. + $this->db_add_param($this->updatevon).');'; + } + else + { + $qry='UPDATE public.tbl_notiz SET '. + 'titel='.$this->db_add_param($this->titel).', '. + 'text='.$this->db_add_param($this->text).', '. + 'verfasser_uid='.$this->db_add_param($this->verfasser_uid).', '. + 'bearbeiter_uid='.$this->db_add_param($this->bearbeiter_uid).', '. + 'start='.$this->db_add_param($this->start).', '. + 'ende='.$this->db_add_param($this->ende).', '. + 'erledigt='.$this->db_add_param($this->erledigt,FHC_BOOLEAN).', '. + 'updateamum='.$this->db_add_param($this->updateamum).', '. + 'updatevon='.$this->db_add_param($this->updatevon).' '. + 'WHERE notiz_id='.$this->db_add_param($this->notiz_id,FHC_INTEGER).';'; + } + + if($this->db_query($qry)) + { + if($new) + { + $qry="SELECT currval('seq_notiz_notiz_id') as id;"; + if($result = $this->db_query($qry)) + { + if($row = $this->db_fetch_object($result)) + { + $this->notiz_id = $row->id; + $this->db_query('COMMIT;'); + return true; + } + else + { + $this->errormsg = 'Fehler beim Lesen der Sequence'; + $this->db_query('ROLLBACK'); + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Lesen der Sequence'; + $this->db_query('ROLLBACK'); + return false; + } + } + return true; + } + else + { + $this->errormsg = 'Fehler beim Speichern des Datensatzes'; + return false; + } + } + + /** + * Speichert die Zuordnung einer Notiz + * + */ + public function saveZuordnung() + { + $qry = "INSERT INTO public.tbl_notizzuordnung(notiz_id, projekt_kurzbz, projektphase_id, projekttask_id, + uid, person_id, prestudent_id, bestellung_id, lehreinheit_id, anrechnung_id) VALUES(". + $this->db_add_param($this->notiz_id, FHC_INTEGER).','. + $this->db_add_param($this->projekt_kurzbz).','. + $this->db_add_param($this->projektphase_id, FHC_INTEGER).','. + $this->db_add_param($this->projekttask_id, FHC_INTEGER).','. + $this->db_add_param($this->uid).','. + $this->db_add_param($this->person_id, FHC_INTEGER).','. + $this->db_add_param($this->prestudent_id, FHC_INTEGER).','. + $this->db_add_param($this->bestellung_id, FHC_INTEGER).','. + $this->db_add_param($this->lehreinheit_id, FHC_INTEGER).','. + $this->db_add_param($this->anrechnung_id, FHC_INTEGER).');'; + + if($this->db_query($qry)) + { + return true; + } + else + { + $this->errormsg = 'Fehler beim Speichern der Daten'; + return false; + } + } + + /** + * Speichert ein Dokument zur Notiz + * @param int $dms_id + * @return boolean + */ + public function saveDokument($dms_id) + { + $qry = "INSERT INTO public.tbl_notiz_dokument(notiz_id, dms_id) VALUES(". + $this->db_add_param($this->notiz_id, FHC_INTEGER).','. + $this->db_add_param($dms_id, FHC_INTEGER).');'; + + if($this->db_query($qry)) + { + return true; + } + else + { + $this->errormsg = 'Fehler beim Speichern der Daten'; + return false; + } + } + + /** + * + * Laedt die Notizen + * @param $erledigt + * @param $projekt_kurzbz + * @param $projektphase_id + * @param $projekttask_id + * @param $uid + * @param $person_id + * @param $prestudent_id + * @param $bestellung_id + * @param $user + * @param $lehreinheit_id + * @param $anrechnung_id + * @return boolean + */ + public function getNotiz( + $erledigt=null, + $projekt_kurzbz=null, + $projektphase_id=null, + $projekttask_id=null, + $uid=null, + $person_id=null, + $prestudent_id=null, + $bestellung_id=null, + $user=null, + $lehreinheit_id=null, + $stundenplandev_id=null, + $anrechnung_id=null, + $titel=null) + { + $qry = "SELECT + * + FROM + public.tbl_notiz + LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) + WHERE 1=1"; + + if(!is_null($erledigt)) + { + if($erledigt) + $qry.=" AND erledigt=true"; + else + $qry.=" AND erledigt=false"; + } + if($projekt_kurzbz!='') + $qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz); + if($projektphase_id!='') + $qry.=" AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER); + if($projekttask_id!='') + $qry.=" AND projekttask_id=".$this->db_add_param($projekttask_id, FHC_INTEGER); + if($uid!='') + $qry.=" AND uid=".$this->db_add_param($uid); + if($person_id!='') + $qry.=" AND person_id=".$this->db_add_param($person_id, FHC_INTEGER); + if($prestudent_id!='') + $qry.=" AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER); + if($bestellung_id!='') + $qry.=" AND bestellung_id=".$this->db_add_param($bestellung_id, FHC_INTEGER); + if($user!='') + $qry.=" AND (verfasser_uid=".$this->db_add_param($user)." OR bearbeiter_uid=".$this->db_add_param($user).")"; + if($lehreinheit_id!='') + $qry.=" AND lehreinheit_id=".$this->db_add_param($lehreinheit_id, FHC_INTEGER); + if($anrechnung_id!='') + $qry.=" AND anrechnung_id=".$this->db_add_param($anrechnung_id, FHC_INTEGER); + if($titel!='') + $qry.=" AND titel=".$this->db_add_param($titel); + + $qry.=' ORDER BY start, ende, titel'; + + if($result = $this->db_query($qry)) + { + while($row = $this->db_fetch_object($result)) + { + $obj = new notiz(); + + $obj->notiz_id=$row->notiz_id; + $obj->titel=$row->titel; + $obj->text=$row->text; + $obj->verfasser_uid=$row->verfasser_uid; + $obj->bearbeiter_uid=$row->bearbeiter_uid; + $obj->start=$row->start; + $obj->ende=$row->ende; + $obj->erledigt=$this->db_parse_bool($row->erledigt); + $obj->insertamum=$row->insertamum; + $obj->insertvon=$row->insertvon; + $obj->updateamum=$row->updateamum; + $obj->updatevon=$row->updatevon; + $obj->getDokumente($row->notiz_id); + + $this->result[] = $obj; + } + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * + * Laedt die Notizen vom Bewerbungstool + * @param integer $person_id + * @param integer $prestudent_id + * @param string $order Sorting order. Default: "notiz_id" + * @return boolean + */ + public function getBewerbungstoolNotizen($person_id, $prestudent_id = null, $order = 'notiz_id') + { + $qry = "SELECT + * + FROM + public.tbl_notiz + LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) + WHERE (insertvon = 'online' OR insertvon = 'online_notiz') + AND person_id = ".$this->db_add_param($person_id, FHC_INTEGER); + if ($prestudent_id != '') + { + $qry .= " AND prestudent_id = ".$this->db_add_param($prestudent_id, FHC_INTEGER); + } + + $qry .= " ORDER BY ".$order; + + if($result = $this->db_query($qry)) + { + while($row = $this->db_fetch_object($result)) + { + $obj = new notiz(); + + $obj->notiz_id=$row->notiz_id; + $obj->titel=$row->titel; + $obj->text=$row->text; + $obj->verfasser_uid=$row->verfasser_uid; + $obj->bearbeiter_uid=$row->bearbeiter_uid; + $obj->start=$row->start; + $obj->ende=$row->ende; + $obj->erledigt=$this->db_parse_bool($row->erledigt); + $obj->insertamum=$row->insertamum; + $obj->insertvon=$row->insertvon; + $obj->updateamum=$row->updateamum; + $obj->updatevon=$row->updatevon; + + $this->result[] = $obj; + } + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + + /** + * TEMPORARY: kurzfristig wird für das Onlinebewerbungstool die Ausbildung + * (Name und Adresse der besuchten Schule) in eine Notiz mit + * insertvon = online_ausbildung gespeichert. + * Wird auf UDF umgebaut! + * + * Laedt die Notizen zur Ausbilund vom Bewerbungstool + * @param $person_id int + * @return boolean + */ + public function getBewerbungstoolNotizenAusbildung($person_id) + { + $qry = 'SELECT + * + FROM + public.tbl_notiz + LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) + WHERE person_id = ' . $this->db_add_param($person_id, FHC_INTEGER) . + ' AND insertvon = ' . $this->db_add_param('online_ausbildung') . + ' ORDER BY notiz_id'; + + if($result = $this->db_query($qry)) + { + while($row = $this->db_fetch_object($result)) + { + $obj = new notiz(); + + $obj->notiz_id=$row->notiz_id; + $obj->titel=$row->titel; + $obj->text=$row->text; + $obj->verfasser_uid=$row->verfasser_uid; + $obj->bearbeiter_uid=$row->bearbeiter_uid; + $obj->start=$row->start; + $obj->ende=$row->ende; + $obj->erledigt=$this->db_parse_bool($row->erledigt); + $obj->insertamum=$row->insertamum; + $obj->insertvon=$row->insertvon; + $obj->updateamum=$row->updateamum; + $obj->updatevon=$row->updatevon; + + $this->result[] = $obj; + } + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + + + /** + + * + + * Laedt die Notizen + * @param $erledigt + * @param $projekt_kurzbz + * @param $projektphase_id + * @param $projekttask_id + * @param $uid + * @param $person_id + * @param $prestudent_id + * @param $bestellung_id + * @param $user + * @param $lehreinheit_id + * @param $anrechnung_id + * @return boolean + */ + public function getAnzahlNotizen($erledigt=null, $projekt_kurzbz=null, $projektphase_id=null, $projekttask_id=null, $uid=null, $person_id=null, $prestudent_id=null, $bestellung_id=null, $user=null, $lehreinheit_id=null, $anrechnung_id=null) + { + $qry = "SELECT + count(*) as anzahl + FROM + public.tbl_notiz + LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) + WHERE 1=1"; + + if(!is_null($erledigt)) + { + if($erledigt) + $qry.=" AND erledigt=true"; + else + $qry.=" AND erledigt=false"; + } + if($projekt_kurzbz!='') + $qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz); + if($projektphase_id!='') + $qry.=" AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER); + if($projekttask_id!='') + $qry.=" AND projekttask_id=".$this->db_add_param($projekttask_id, FHC_INTEGER); + if($uid!='') + $qry.=" AND uid=".$this->db_add_param($uid); + if($person_id!='') + $qry.=" AND person_id=".$this->db_add_param($person_id, FHC_INTEGER); + if($prestudent_id!='') + $qry.=" AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER); + if($bestellung_id!='') + $qry.=" AND bestellung_id=".$this->db_add_param($bestellung_id, FHC_INTEGER); + if($user!='') + $qry.=" AND (verfasser_uid=".$this->db_add_param($user)." OR bearbeiter_uid=".$this->db_add_param($user).")"; + if($lehreinheit_id!='') + $qry.=" AND lehreinheit_id=".$this->db_add_param($lehreinheit_id, FHC_INTEGER); + if($anrechnung_id!='') + $qry.=" AND anrechnung_id=".$this->db_add_param($anrechnung_id, FHC_INTEGER); + + if($result = $this->db_query($qry)) + { + if($row = $this->db_fetch_object($result)) + return $row->anzahl; + else + { + $this->errormsg='Fehler beim Laden der Daten'; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * Laedt die Dokumente der Notiz + * @return boolean + */ + public function getDokumente($notiz_id) + { + $qry = "SELECT dms_id FROM public.tbl_notiz_dokument WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); + + if($this->db_query($qry)) + { + while($row = $this->db_fetch_object()) + { + $this->dokumente[] = $row->dms_id; + } + + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * Prueft ob das Dokument an einer Notiz haengt + * @param $dms_id DMS id des Dokuments. + * @return boolean true wenn das Dokument an einer Notiz hängt, sonst false. + */ + public function isNotizDokument($dms_id) + { + $qry = "SELECT * FROM public.tbl_notiz_dokument WHERE dms_id=".$this->db_add_param($dms_id, FHC_INTEGER); + + if($result = $this->db_query($qry)) + { + if($this->db_num_rows($result)>0) + return true; + else + return false; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } +} diff --git a/include/prestudent.class.php b/include/prestudent.class.php index 823e5a9aa..eb8767883 100644 --- a/include/prestudent.class.php +++ b/include/prestudent.class.php @@ -1,5 +1,5 @@ , - * Andreas Oesterreicher and - * Rudolf Hangl . + * Andreas Oesterreicher , + * Rudolf Hangl and + * Manuela Thamer . */ require_once(dirname(__FILE__).'/person.class.php'); require_once(dirname(__FILE__).'/log.class.php'); @@ -2215,9 +2216,9 @@ class prestudent extends person WHERE laststatus NOT IN ('Abbrecher', 'Abgewiesener', 'Absolvent') AND priorisierung <= ".$this->db_add_param($priorisierungAbsolut, FHC_INTEGER); - if($result = $this->db_query($qry)) + if ($result = $this->db_query($qry)) { - if($row = $this->db_fetch_object($result)) + if ($row = $this->db_fetch_object($result)) { return $row->prio_relativ; } @@ -2232,6 +2233,222 @@ class prestudent extends person $this->errormsg = 'Fehler beim Laden der Daten'; return false; } + } + /** + * Prueft, ob eine Person einen aktuellen PreStudentstatus-Eintrag besitzt, der die ZGV Master ersetzt + * @param int $person_id ID der zu überprüfenden Person. + * @return true wenn vorhanden + * false wenn nicht vorhanden + * false und errormsg wenn Fehler aufgetreten ist + */ + public function existsZGVIntern($person_id) + { + if (!is_numeric($person_id)) + { + $this->errormsg = 'Person_id muss eine gueltige Zahl sein'; + return false; + } + + + $qry = "SELECT count(*) as anzahl FROM public.tbl_prestudent + JOIN public.tbl_prestudentstatus USING (prestudent_id) + JOIN public.tbl_studiengang USING (studiengang_kz) + WHERE person_id = ".$this->db_add_param($person_id, FHC_INTEGER)." + AND status_kurzbz in ('Absolvent','Diplomand','Unterbrecher','Student') + AND typ in ('b','m','d')"; + + + if ($this->db_query($qry)) + { + if ($row = $this->db_fetch_object()) + { + if ($row->anzahl > 0) + { + $this->errormsg = ''; + return true; + } + else + { + $this->errormsg = ''; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * Befüllt MasterZGV-Felder: Nation mit Österreich und MasterZGV-code mit FH-Bachelor(I) + * @param int $person_id Personenkennzeichen. + * @param varchar $ort Ort. + * @return true wenn erfolgreich durchgeführt + * false und errormsg wenn ein Fehler aufgetreten ist + */ + public function setZGVMasterFields($person_id, $ort) + { + if (!is_numeric($person_id)) + { + $this->errormsg = 'Person_id muss eine gueltige Zahl sein'; + return false; + } + + $db = new basis_db(); + $arrayleereManations = array(); + + //all prestudent_ids mit Status Interessent + $qry = "SELECT + * + FROM + public.tbl_prestudent + JOIN + public.tbl_studiengang USING (studiengang_kz) + WHERE + person_id = ".$this->db_add_param($person_id)." + AND + typ ='m' + And + get_rolle_prestudent(prestudent_id, null) = 'Interessent';"; + + if ($db->db_query($qry)) + { + $num_rows = $db->db_num_rows(); + + if ($num_rows > 0) + { + while ($row = $db->db_fetch_object()) + { + $arrayleereManations[] = $row->prestudent_id; + } + + if ($arrayleereManations) + { + $qry = "UPDATE + public.tbl_prestudent + SET + (zgvmanation, zgvmaort, zgvmas_code) = ('A',".$this->db_add_param($ort).",1) + WHERE + prestudent_id in ("; + + foreach ($arrayleereManations as $prestudent_id) + { + $qry .= $prestudent_id; + + if (next($arrayleereManations) == true) + { + $qry .= ","; + } + } + $qry .= ");"; + + if ($this->db_query($qry)) + { + return true; + } + else + { + $this->errormsg = 'Fehler beim Eintragen zgvMasterFields'; + return false; + } + } + } + else + return true; + } + } + + + /** + * Prueft, ob eine Person einen aktuellen PreStudentstatus-Eintrag Interessent für einen Masterstudiengang besitzt + * @param int $person_id ID der zu überprüfenden Person. + * @return true wenn vorhanden, false wenn nicht vorhanden + */ + public function existsStatusInteressentMaster($person_id) + { + if (!is_numeric($person_id)) + { + $this->errormsg = 'Person_id muss eine gueltige Zahl sein'; + return false; + } + + $db = new basis_db(); + $prestudentsOfMaster = array(); + + $qry = "SELECT + prestudent_id + FROM + tbl_prestudent ps, tbl_studiengang sg + WHERE + ps.studiengang_kz = sg.studiengang_kz + AND + sg.typ in ('m') + AND + person_id = ".$this->db_add_param($person_id)." + And + get_rolle_prestudent(prestudent_id, null) = 'Interessent';"; + + if ($db->db_query($qry)) + { + $num_rows = $db->db_num_rows(); + if ($num_rows > 0) + { + return true; + } + } + else + return false; + } + + + /** + * Liefert den wahrscheinlichen Studiengang der MasterZGV einer Person + * @param int $person_id ID der zu überprüfenden Person. + * @return string studiengangkurzbzlang + */ + public function getZGVMasterStg($person_id) + { + if (!is_numeric($person_id)) + { + $this->errormsg = 'Person_id muss eine gueltige Zahl sein'; + return false; + } + + $qry = "SELECT kurzbzlang + FROM public.tbl_prestudent + JOIN public.tbl_prestudentstatus USING (prestudent_id) + JOIN public.tbl_studiengang USING (studiengang_kz) + WHERE person_id = ".$this->db_add_param($person_id, FHC_INTEGER)." + AND status_kurzbz in ('Absolvent','Diplomand','Unterbrecher','Student') + AND typ in ('b','m','d') + ORDER BY status_kurzbz ASC + LIMIT 1;"; + + if ($this->db_query($qry)) + { + if ($row = $this->db_fetch_object()) + { + $stg = $row->kurzbzlang; + return $stg; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } } } diff --git a/include/sancho.inc.php b/include/sancho.inc.php index b52a7fb28..5fc6fcdab 100644 --- a/include/sancho.inc.php +++ b/include/sancho.inc.php @@ -33,10 +33,12 @@ const DEFAULT_SANCHO_FOOTER_IMG = 'sancho_footer_DEFAULT.jpg'; * @param string $to Email-adress. * @param string $subject Subject of mail. * @param string $headerImg Filename of the specific Sancho header image. + * @param string $footerImg * @param string $replyTo default Email-adress for reply. + * @param string | array $cc * @return boolean True, if succeeded. */ -function sendSanchoMail($vorlage_kurzbz, $vorlage_data, $to, $subject, $headerImg = DEFAULT_SANCHO_HEADER_IMG, $footerImg = DEFAULT_SANCHO_FOOTER_IMG, $replyTo = '') +function sendSanchoMail($vorlage_kurzbz, $vorlage_data, $to, $subject, $headerImg = DEFAULT_SANCHO_HEADER_IMG, $footerImg = DEFAULT_SANCHO_FOOTER_IMG, $replyTo = '', $cc = '') { $from = 'sancho@'. DOMAIN; $sanchoHeader_img = dirname(__FILE__). '/../skin/images/sancho/'. $headerImg; @@ -69,6 +71,10 @@ function sendSanchoMail($vorlage_kurzbz, $vorlage_data, $to, $subject, $headerIm // * Set reply-to if (isset($replyTo) && $replyTo != '') $mail->setReplyTo($replyTo); + + // * Set cc + if (isset($cc) && $cc != '') + $mail->setCCRecievers($cc); // * embed the html content $mail->setHTMLContent($body); diff --git a/locale/de-AT/urlaubstool.php b/locale/de-AT/urlaubstool.php index cd34be0da..6d6edde09 100644 --- a/locale/de-AT/urlaubstool.php +++ b/locale/de-AT/urlaubstool.php @@ -40,4 +40,10 @@ $this->phrasen['urlaubstool/freigegebenerUrlaubGeloescht']='Bereits Freigegebene $this->phrasen['urlaubstool/VorgesetzteInformiert']='Email wurde an %s versandt'; $this->phrasen['urlaubstool/konnteKeinInformationsemailVersendetWerden']='Es konnte kein Email versendet werden, da kein Vorgesetzter eingetragen ist!'; $this->phrasen['urlaubstool/xHatUrlaubGeloescht']='%s %s hat bereits freigegebenen Urlaub gelöscht'; +$this->phrasen['urlaubstool/urlaubsfreigabe']='Freigabe Urlaub: '; +$this->phrasen['urlaubstool/bestaetigungsmailWurdeVersandt']='Bestätigungsmail an %s versandt'; +$this->phrasen['urlaubstool/urlaubVon']='Ihr angefragter Urlaub von'; +$this->phrasen['urlaubstool/urlaubBis']=' wurde von %s freigegeben.'; +$this->phrasen['urlaubstool/sieKoennenDiesenUnterFolgenderAdresseEinsehen']='Sie können diesen unter folgender Adresse einsehen:'; + ?> diff --git a/locale/en-US/urlaubstool.php b/locale/en-US/urlaubstool.php index f52f2d981..697117c34 100644 --- a/locale/en-US/urlaubstool.php +++ b/locale/en-US/urlaubstool.php @@ -36,4 +36,10 @@ $this->phrasen['urlaubstool/meineZeitsperren']='My Planned Absences'; $this->phrasen['urlaubstool/sieKoennenDiesenUnterFolgenderAdresseFreigeben']='Sie können diesen unter folgender Adresse freigeben'; //Nur übersetzen, wenn die eMail in der eingestellten Sprache versandt werden soll $this->phrasen['urlaubstool/freigabeansuchenUrlaub']='Freigabeansuchen Urlaub'; //Nur übersetzen, wenn die eMail in der eingestellten Sprache versandt werden soll $this->phrasen['urlaubstool/freigabeFehlt']='Vacation has not been approved yet'; +$this->phrasen['urlaubstool/urlaubsfreigabe']='Vacation approval: '; +$this->phrasen['urlaubstool/bestaetigungsmailWurdeVersandt']='Confirmation mail to %s sent'; +$this->phrasen['urlaubstool/urlaubVon']='Ihr angefragter Urlaub von'; //Nur übersetzen, wenn die eMail in der eingestellten Sprache versandt werden soll +$this->phrasen['urlaubstool/urlaubBis']=' wurde von %s freigegeben.'; //Nur übersetzen, wenn die eMail in der eingestellten Sprache versandt werden soll +$this->phrasen['urlaubstool/sieKoennenDiesenUnterFolgenderAdresseEinsehen']='Sie können diesen unter folgender Adresse einsehen:'; //Nur übersetzen, wenn die eMail in der eingestellten Sprache versandt werden soll + ?> diff --git a/public/css/infocenter/infocenterDetails.css b/public/css/infocenter/infocenterDetails.css index 38a7824fa..2f2debc00 100644 --- a/public/css/infocenter/infocenterDetails.css +++ b/public/css/infocenter/infocenterDetails.css @@ -76,6 +76,17 @@ font-weight: normal; } +.nachreichungInfos +{ + float: right; + margin: 5px 15px 0 0; +} + +.nachreichungInputs .row +{ + margin-top: 5px; +} + @media screen and (max-width: 1510px) { #postponing{ diff --git a/public/js/infocenter/docUeberpruefung.js b/public/js/infocenter/docUeberpruefung.js new file mode 100644 index 000000000..acb0ca60f --- /dev/null +++ b/public/js/infocenter/docUeberpruefung.js @@ -0,0 +1,218 @@ +const ALLOWED_DOC_TYPES = ['VorlSpB2', 'ZgvBaPre', 'ZgvMaPre']; + +$(document).ready(function () +{ + DocUeberpruefung._formatDocTable(); + DocUeberpruefung.checkNachreichungButtons(); + + var personid = $("#hiddenpersonid").val(); + + //add click events to "formal geprüft" checkboxes + $(".prchbox").click(function () + { + var boxid = this.id; + var akteid = InfocenterDetails._getPrestudentIdFromElementId(boxid); + var checked = this.checked; + DocUeberpruefung.saveFormalGeprueft(personid, akteid, checked) + }); + + $('select.aktenid').change(function() + { + var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + var typ = $(this).val(); + DocUeberpruefung.saveDocTyp(personid, akteid, typ); + }); + + $('.nachreichungInfos').click(function() + { + var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + DocUeberpruefung.checkNachreichungInputs(akteid); + }); + + $('.nachreichungAbbrechen').click(function() + { + var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + DocUeberpruefung.checkNachreichungInputs(akteid); + }); + + $('.nachreichungSpeichern').click(function() + { + var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + var typ = $('#aktenid_' + akteid).val(); + + var nachreichungAm = $('#nachreichungAm_' + akteid).val(); + var nachreichungAnmerkung = $('#nachreichungAnmerkung_' + akteid).val(); + + if(nachreichungAm === '') + { + FHC_DialogLib.alertError(FHC_PhrasesLib.t('infocenter', 'datumUngueltig')); + return false; + } + + var regEx = /^\d{2}\.\d{2}\.(\d{2}|\d{4})$/; + + if(nachreichungAm.match(regEx) === null) + { + FHC_DialogLib.alertError(FHC_PhrasesLib.t('infocenter', 'datumUngueltig')) + return false; + } + + DocUeberpruefung.saveNachreichung(personid, nachreichungAm, nachreichungAnmerkung, typ); + }) +}); + +var DocUeberpruefung = { + + saveFormalGeprueft: function(personid, akteid, checked) + { + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + '/saveFormalGeprueft/' + encodeURIComponent(personid), + { + akte_id: akteid, + formal_geprueft: checked + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.hasData(data)) + { + var timestamp = data.retval[0]; + if (timestamp === "") + { + $("#formalgeprueftam_" + akteid).text(""); + } + else + { + var fgdatum = $.datepicker.parseDate("yy-mm-dd", timestamp); + var gerfgdatum = $.datepicker.formatDate("dd.mm.yy", fgdatum); + $("#formalgeprueftam_" + akteid).text(gerfgdatum); + } + //refresh doctable tablesorter, formal geprueft changed! + $("#doctable").trigger("update"); + InfocenterDetails._refreshLog(); + } + else + { + InfocenterDetails._genericSaveError(); + } + }, + errorCallback: InfocenterDetails._genericSaveError, + veilTimeout: 0 + } + ); + }, + + saveDocTyp: function(personid, akteid, typ) + { + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + "/saveDocTyp/" + encodeURIComponent(personid), + { + "akte_id": akteid, + "typ" : typ + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.isSuccess(data)) + { + FHC_DialogLib.alertSuccess("Done!"); + InfocenterDetails._refreshLog(); + DocUeberpruefung.checkNachreichungButton(akteid); + } + else + { + FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); + } + }, + errorCallback: function() { + FHC_DialogLib.alertWarning("Fehler beim Speichern!"); + } + } + ); + }, + + saveNachreichung: function (personid, nachreichungAm, nachreichungAnmerkung, typ) + { + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + "/saveNachreichung/" + encodeURIComponent(personid), + { + "nachreichungAm": nachreichungAm, + "nachreichungAnmerkung" : nachreichungAnmerkung, + "typ" : typ + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.isSuccess(data)) + { + DocUeberpruefung._refreshNachzureichendeDoks(); + InfocenterDetails._refreshLog(); + FHC_DialogLib.alertSuccess("Done!"); + } + else + { + FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); + } + }, + errorCallback: function() { + FHC_DialogLib.alertWarning("Fehler beim Speichern!"); + } + } + ); + }, + + checkNachreichungInputs: function(akteid) + { + var inputs = $('#nachreichungInputs_' + akteid); + + if (inputs.hasClass('hidden')) + { + inputs.removeClass('hidden'); + } + else + { + inputs.addClass('hidden'); + $('#nachreichungAnmerkung_' + akteid).val(""); + $('#nachreichungAm_' + akteid).val(""); + } + }, + + checkNachreichungButtons: function() + { + $('select.aktenid').each(function () { + var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + DocUeberpruefung.checkNachreichungButton(akteid); + }); + }, + + checkNachreichungButton: function(akteid) + { + var typ = $('#aktenid_' + akteid).val(); + var infos = $('#nachreichungInfos_' + akteid); + + if ($.inArray(typ, ALLOWED_DOC_TYPES) === -1) + { + infos.addClass('hidden'); + } + else + { + infos.removeClass('hidden'); + } + }, + + _refreshNachzureichendeDoks: function() + { + var personid = $("#hiddenpersonid").val(); + + $("#nachzureichendeDoks").load( + CONTROLLER_URL + '/reloadDoks/' + personid + '?fhc_controller_id=' + FHC_AjaxClient.getUrlParameter('fhc_controller_id'), + function () { + DocUeberpruefung._formatDocTable(); + } + ); + }, + + _formatDocTable: function() + { + Tablesort.addTablesorter("doctable", [[2, 1], [1, 0]], ["zebra"]); + Tablesort.addTablesorter("nachgdoctable", [[2, 0], [1, 1]], ["zebra"]); + }, + +} \ No newline at end of file diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 7023af277..70f5ed982 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -3,9 +3,13 @@ const BASE_URL = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJEC const CALLED_PATH = FHC_JS_DATA_STORAGE_OBJECT.called_path; const CONTROLLER_URL = BASE_URL + "/"+CALLED_PATH; const RTFREIGABE_MESSAGE_VORLAGE = "InfocenterRTfreigegeben"; +const RTFREIGABE_MESSAGE_VORLAGE_MASTER = "InfocenterRTfreigegebenM"; +const RTFREIGABE_MESSAGE_VORLAGE_MASTER_ENGLISCH = "InfocenterRTfreigegebenMEnglisch"; const RTFREIGABE_MESSAGE_VORLAGE_QUER = "InfocenterRTfreigegQuer"; const RTFREIGABE_MESSAGE_VORLAGE_QUER_KURZ = "InfocenterRTfreigegQuerKurz"; const STGFREIGABE_MESSAGE_VORLAGE = "InfocenterSTGfreigegeben"; +const STGFREIGABE_MESSAGE_VORLAGE_MASTER = "InfocenterSTGfreigegebenM"; +const STGFREIGABE_MESSAGE_VORLAGE_MASTER_ENGLISCH = "InfocenterSTGfreigegebenMEng"; //Statusgründe for which no Studiengang Freigabe Message should be sent const FIT_PROGRAMM_STUDIENGAENGE = [10021, 10027]; @@ -18,9 +22,6 @@ const ONHOLDNAME = 'onhold'; */ $(document).ready(function () { - //initialise table sorter - Tablesort.addTablesorter("doctable", [[2, 1], [1, 0]], ["zebra"]); - Tablesort.addTablesorter("nachgdoctable", [[2, 0], [1, 1]], ["zebra"]); InfocenterDetails._formatMessageTable(); InfocenterDetails._formatNotizTable(); @@ -34,15 +35,6 @@ $(document).ready(function () $("#sendmsgform").submit(); }); - //add click events to "formal geprüft" checkboxes - $(".prchbox").click(function () - { - var boxid = this.id; - var akteid = InfocenterDetails._getPrestudentIdFromElementId(boxid); - var checked = this.checked; - InfocenterDetails.saveFormalGeprueft(personid, akteid, checked) - }); - //add click events to zgv Prüfung section InfocenterDetails._addZgvPruefungEvents(personid); @@ -114,7 +106,8 @@ $(document).ready(function () { $('html,body').animate({scrollTop:0},250,'linear'); } - ) + ); + }); var InfocenterDetails = { @@ -129,43 +122,6 @@ var InfocenterDetails = { // ----------------------------------------------------------------------------------------------------------------- // ajax calls - saveFormalGeprueft: function(personid, akteid, checked) - { - FHC_AjaxClient.ajaxCallPost( - CALLED_PATH + '/saveFormalGeprueft/' + encodeURIComponent(personid), - { - akte_id: akteid, - formal_geprueft: checked - }, - { - successCallback: function(data, textStatus, jqXHR) { - if (FHC_AjaxClient.hasData(data)) - { - var timestamp = data.retval[0]; - if (timestamp === "") - { - $("#formalgeprueftam_" + akteid).text(""); - } - else - { - var fgdatum = $.datepicker.parseDate("yy-mm-dd", timestamp); - var gerfgdatum = $.datepicker.formatDate("dd.mm.yy", fgdatum); - $("#formalgeprueftam_" + akteid).text(gerfgdatum); - } - //refresh doctable tablesorter, formal geprueft changed! - $("#doctable").trigger("update"); - InfocenterDetails._refreshLog(); - } - else - { - InfocenterDetails._genericSaveError(); - } - }, - errorCallback: InfocenterDetails._genericSaveError, - veilTimeout: 0 - } - ); - }, saveBewPriorisierung: function(data) { FHC_AjaxClient.ajaxCallPost( @@ -207,6 +163,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 { @@ -221,6 +193,7 @@ var InfocenterDetails = { } ); }, + saveZgv: function(data) { var zgvError = function(){ @@ -340,8 +313,9 @@ var InfocenterDetails = { } ); }, - saveNotiz: function(personid, data) + saveNotiz: function(personid, data, callback) { + var callbackValue = data; FHC_AjaxClient.ajaxCallPost( CALLED_PATH + '/saveNotiz/' + encodeURIComponent(personid), data, @@ -351,6 +325,8 @@ var InfocenterDetails = { { InfocenterDetails._refreshNotizen(); InfocenterDetails._refreshLog(); + if ($.isFunction(callback)) + callback(callbackValue); } else { @@ -595,8 +571,9 @@ var InfocenterDetails = { { var fitstg = $.inArray(parseInt(prestudent.studiengang_kz), FIT_PROGRAMM_STUDIENGAENGE) >= 0; - if (receiverPrestudentstatus.studiensemester_kurzbz === prestudentstatus.studiensemester_kurzbz - && (prestudent.studiengangtyp === "b" || fitstg)) + if ((receiverPrestudentstatus.studiensemester_kurzbz === prestudentstatus.studiensemester_kurzbz) + && (receiverPrestudent.studiengangtyp === prestudent.studiengangtyp) + && (prestudent.studiengangtyp === "b" || prestudent.studiengangtyp === "m" || fitstg)) { if (prestudent.isRtFreigegeben) { @@ -613,13 +590,14 @@ var InfocenterDetails = { var ausbildungssemester = receiverPrestudentstatus.ausbildungssemester; var studiengangbezeichnung = receiverPrestudentstatus.studiengangbezeichnung; var studiengangbezeichnung_englisch = receiverPrestudentstatus.studiengangbezeichnung_englisch; + var vorlage = null; var orgform_deutsch, orgform_englisch; orgform_deutsch = orgform_englisch = ""; if (typeof receiverPrestudentstatus.bezeichnung_orgform_german === 'string') { - orgform_deutsch = receiverPrestudentstatus.bezeichnung_orgform_german.toLowerCase(); + orgform_deutsch = receiverPrestudentstatus.bezeichnung_orgform_german; } if (typeof receiverPrestudentstatus.bezeichnung_orgform_english === 'string') @@ -650,7 +628,6 @@ var InfocenterDetails = { } else //not already for RT freigegeben - send RTfreigabe message { - var vorlage = null; //send Quereinstiegsmessage if later Ausbildungssemester if (ausbildungssemester > 1) { @@ -660,7 +637,15 @@ var InfocenterDetails = { else { //send normal RTfreigabe message - vorlage = RTFREIGABE_MESSAGE_VORLAGE + if (receiverPrestudent.studiengangtyp === 'm') { + if (receiverPrestudentstatus.sprache === 'English') + vorlage = RTFREIGABE_MESSAGE_VORLAGE_MASTER_ENGLISCH + else + vorlage = RTFREIGABE_MESSAGE_VORLAGE_MASTER + } else + { + vorlage = RTFREIGABE_MESSAGE_VORLAGE + } } InfocenterDetails.sendFreigabeMessage(prestudent_id, vorlage, msgvars); @@ -668,8 +653,23 @@ var InfocenterDetails = { } else { + if (receiverPrestudent.studiengangtyp === 'm' && (freigabedata.statusgrundbezeichnung === 'Ergänzungsprüfungen' || freigabedata.statusgrundbezeichnung === 'Supplementary exams')) + { + msgvars = { + 'studiengangbezeichnung': studiengangbezeichnung, + 'studiengangbezeichnung_englisch': studiengangbezeichnung_englisch, + 'orgform_deutsch': orgform_deutsch, + 'orgform_englisch': orgform_englisch + } + if (receiverPrestudentstatus.sprache === 'English') + vorlage = STGFREIGABE_MESSAGE_VORLAGE_MASTER_ENGLISCH + else + vorlage = STGFREIGABE_MESSAGE_VORLAGE_MASTER + + InfocenterDetails.sendFreigabeMessage(prestudent_id, vorlage, msgvars); + } //if Freigabe to Studiengang, send StgFreigabe Message if not already sent and allowed to send - if (!stgFreigegeben && receiverPrestudent.sendStgFreigabeMsg === true) + else if (!stgFreigegeben && receiverPrestudent.sendStgFreigabeMsg === true) { InfocenterDetails.sendFreigabeMessage(prestudent_id, STGFREIGABE_MESSAGE_VORLAGE, msgvars); } @@ -746,6 +746,10 @@ var InfocenterDetails = { InfocenterDetails.zgvUebernehmen(personid, prestudentid, btn); }); + $('.notizModal').on('hidden.bs.modal', function () { + $(':input', this).val(''); + }); + //zgv speichern $(".saveZgv").click(function () { @@ -885,6 +889,8 @@ var InfocenterDetails = { } } ); + + zgvUeberpruefung.checkAfterReload(); }, _refreshMessages: function() { diff --git a/public/js/infocenter/infocenterPersonDataset.js b/public/js/infocenter/infocenterPersonDataset.js index 87a40c0f1..252f6ac1f 100644 --- a/public/js/infocenter/infocenterPersonDataset.js +++ b/public/js/infocenter/infocenterPersonDataset.js @@ -20,22 +20,44 @@ 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 auswahlStudienart = + ''; + + var auswahlAbsageToggle = + 'Erweiterte Einstellungen'; + + var auswahlAbsage = + '' + + '' + + ''; + + InfocenterPersonDataset.getAbsageData(); + var studienSemesterHtml = ' ' + infocenter_studiensemester + - ' '; @@ -56,10 +78,28 @@ 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')); + }); + + $("#datasetActionsBottom").append( + "
"+ + "
"+auswahlAbsageToggle+"
"+ + ""+ + "
" + + "
" + + "
" + ) $("button.incStudiensemester").click(function() { InfocenterPersonDataset.changeStudiensemesterUservar(1); }); @@ -68,6 +108,29 @@ var InfocenterPersonDataset = { InfocenterPersonDataset.changeStudiensemesterUservar(-1); }); + $('button.auswahlAbsageBtn').click(function() + { + var idsel = $("#filterTableDataset input:checked[name=PersonId\\[\\]]"); + + if(idsel.length <= 0) + return FHC_DialogLib.alertInfo("Bitte wählen Sie die Personen aus."); + + if($('.absgstatusgrund').val() === 'null' || $('.auswahlAbsageStg').val() === 'null') + return FHC_DialogLib.alertInfo("Bitte den Absagegrund und Studiengang auswählen."); + + $(".absageModalForAll").modal("show"); + }); + + $('#saveAbsageForAll').click(function() + { + InfocenterPersonDataset.saveAbsageForAll(); + }); + + $('a.absageToggle').click(function() + { + $('#absagePunkte').toggle(); + }) + var personcount = 0; FHC_AjaxClient.ajaxCallGet( @@ -115,6 +178,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 +252,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) @@ -203,6 +321,75 @@ var InfocenterPersonDataset = { ); }, + saveAbsageForAll: function() + { + var idsel = $("#filterTableDataset input:checked[name=PersonId\\[\\]]"); + + var statusgrund = $('.absgstatusgrund').val(); + var studiengang = $('.auswahlAbsageStg').val(); + + var personen = []; + + for (var i = 0; i < idsel.length; i++) + { + personen.push($(idsel[i]).val()); + } + + FHC_AjaxClient.ajaxCallPost( + 'system/infocenter/InfoCenter/saveAbsageForAll', + { + 'statusgrund': statusgrund, + 'studiengang': studiengang, + 'personen' : personen + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.isError(data)) + FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); + + if (FHC_AjaxClient.hasData(data)) + FHC_DialogLib.alertSuccess("Erfolgreich gespeichert.") + + $(".absageModalForAll").modal("hide"); + }, + errorCallback: function(jqXHR, textStatus, errorThrown) { + FHC_DialogLib.alertError(textStatus); + } + } + ); + }, + + getAbsageData: function() + { + FHC_AjaxClient.ajaxCallGet( + 'system/infocenter/InfoCenter/getAbsageData', + {}, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.hasData(data)) + { + data = FHC_AjaxClient.getData(data); + $.each(data.statusgruende, function(key, value){ + $('.absgstatusgrund').append($("
$emailEditEdit"; if ($row->lektor) { diff --git a/vilesci/personen/zeitwunsch.php b/vilesci/personen/zeitwunsch.php index 36f1c5e87..416c6387d 100644 --- a/vilesci/personen/zeitwunsch.php +++ b/vilesci/personen/zeitwunsch.php @@ -66,7 +66,7 @@ $updatevon = 0; // Zeitwuensche speichern if (isset($_POST['save'])) { - if(!$rechte->isBerechtigt('mitarbeiter', null, 'suid')) + if(!$rechte->isBerechtigt('mitarbeiter/zeitwuensche', null, 'suid')) die($rechte->errormsg); for ($t=1;$t<7;$t++) @@ -157,7 +157,13 @@ $updatevon = 0; ?>
'.$tagbez[1][$j].'