diff --git a/application/controllers/person/Gruppenmanagement.php b/application/controllers/person/Gruppenmanagement.php index 1a4c341a4..099871676 100644 --- a/application/controllers/person/Gruppenmanagement.php +++ b/application/controllers/person/Gruppenmanagement.php @@ -29,6 +29,7 @@ class Gruppenmanagement extends Auth_Controller $this->load->model('person/benutzer_model', 'BenutzerModel'); $this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel'); $this->load->model('person/benutzergruppe_model', 'BenutzergruppeModel'); + $this->load->model('person/gruppe_manager_model', 'GruppemanagerModel'); $this->load->model('system/Log_model', 'LogModel'); $this->load->library('WidgetLib'); @@ -117,6 +118,27 @@ class Gruppenmanagement extends Auth_Controller $result = error('Uid missing'); else { + $this->GruppemanagerModel->addSelect('1'); + $isManagerRes = $this->GruppemanagerModel->loadWhere( + array( + 'uid' => $this->_uid, + 'gruppe_kurzbz' => $gruppe_kurzbz + ) + ); + + if (isError($isManagerRes)) + { + $this->outputJsonError(getError($isManagerRes)); + return; + } + + if (!hasData($isManagerRes)) + { + $this->outputJsonError($this->p->t('gruppenmanagement', 'nichtZumEditierenDerGruppeBerechtigt')); + return; + } + + $this->BenutzergruppeModel->addSelect('1'); $benutzerExistsRes = $this->BenutzergruppeModel->loadWhere( array( 'uid' => $uid, @@ -170,6 +192,26 @@ class Gruppenmanagement extends Auth_Controller $result = error('Uid missing'); else { + $this->GruppemanagerModel->addSelect('1'); + $isManagerRes = $this->GruppemanagerModel->loadWhere( + array( + 'uid' => $this->_uid, + 'gruppe_kurzbz' => $gruppe_kurzbz + ) + ); + + if (isError($isManagerRes)) + { + $this->outputJsonError(getError($isManagerRes)); + return; + } + + if (!hasData($isManagerRes)) + { + $this->outputJsonError($this->p->t('gruppenmanagement', 'nichtZumEditierenDerGruppeBerechtigt')); + return; + } + $result = $this->BenutzergruppeModel->delete( array( 'uid' => $uid, diff --git a/application/models/person/Gruppe_manager_model.php b/application/models/person/Gruppe_manager_model.php new file mode 100644 index 000000000..93d45bd1f --- /dev/null +++ b/application/models/person/Gruppe_manager_model.php @@ -0,0 +1,14 @@ +dbTable = 'public.tbl_gruppe_manager'; + $this->pk = 'gruppe_manager_id'; + } +} diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 61dc5a575..956ad80d4 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -7,6 +7,7 @@ $STUDIENGANG_TYP = '\''.$this->variablelib->getVar('infocenter_studiensgangtyp').'\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'Interessent rejected\', \'Attempt to register with existing mailadress\', \'Access code sent\', \'Personal data saved\''; + $LOGDATA_DELETED_BY_USER = '\'% deleted by user\''; $POSTPONE_STATUS_PARKED = '\'parked\''; $STATUS_KURZBZ = '\'Wartender\', \'Bewerber\', \'Aufgenommener\', \'Student\''; $ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz'); @@ -283,6 +284,7 @@ FROM system.tbl_log l WHERE l.taetigkeit_kurzbz IN ('.$TAETIGKEIT_KURZBZ.') AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') + AND l.logdata->>\'message\' NOT LIKE ('.$LOGDATA_DELETED_BY_USER.') AND l.person_id = p.person_id ORDER BY l.log_id DESC LIMIT 1 diff --git a/content/student/studentenoverlay.xul.php b/content/student/studentenoverlay.xul.php index cdaa2e69b..739cde39c 100644 --- a/content/student/studentenoverlay.xul.php +++ b/content/student/studentenoverlay.xul.php @@ -208,6 +208,7 @@ else + diff --git a/rdf/student.rdf.php b/rdf/student.rdf.php index 40cf28e01..61c903bd6 100644 --- a/rdf/student.rdf.php +++ b/rdf/student.rdf.php @@ -190,6 +190,25 @@ function checkfilter($row, $filter2, $buchungstyp = null) : false; return $filtered; } + else if ($filter2 === 'ueberfaelligebuchungen') + { + $qry = "SELECT sum(betrag) as summe + FROM tbl_konto + WHERE person_id=".$db->db_add_param($row->person_id, FHC_INTEGER) ." + AND buchungsdatum < NOW() + " + ; + + if($kontofilterstg=='true') + $qry.=" AND studiengang_kz=".$db->db_add_param($row->studiengang_kz); + if($buchungstyp != null && $buchungstyp != "alle") + $qry.=" AND buchungstyp_kurzbz=".$db->db_add_param($buchungstyp); + + if($db->db_query($qry)) + if($row_filter = $db->db_fetch_object()) + if($row_filter->summe=='0.00' || $row_filter->summe=='' || $row_filter->summe=='0') + return false; + } return true; } diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 9179d0e7c..27b8306f0 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -37196,8 +37196,28 @@ array( 'insertvon' => 'system' ) ) - ) + ), // CIS4 phrases from legacy code end + array( + 'app' => 'core', + 'category' => 'gruppenmanagement', + 'phrase' => 'nichtZumEditierenDerGruppeBerechtigt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Nicht zum Editieren der Gruppe berechtigt", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "No authorization for editing the group", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ) ); diff --git a/vilesci/personen/leistungsstipendium.php b/vilesci/personen/leistungsstipendium.php index 0ee4ab8b1..45732c902 100644 --- a/vilesci/personen/leistungsstipendium.php +++ b/vilesci/personen/leistungsstipendium.php @@ -23,12 +23,12 @@ require_once("../../config/vilesci.config.inc.php"); require_once("../../include/functions.inc.php"); require_once("../../include/benutzerberechtigung.class.php"); require_once("../../include/datum.class.php"); - require_once("../../include/studiengang.class.php"); require_once("../../include/studiensemester.class.php"); require_once("../../include/studienjahr.class.php"); require_once("../../include/student.class.php"); require_once("../../include/konto.class.php"); +require_once("../../include/bankverbindung.class.php"); // Get the uid of the logged user $user = get_uid(); @@ -71,7 +71,7 @@ $fileTmpName = null; $fileMimeType = null; // Constants -$L_CSV_N_COLS = 6; // Number of columns of the CSV file +$L_CSV_N_COLS = 10; // Number of columns of the CSV file $L_ERROR = "Error"; $L_WARNING = "Warning"; $L_INFO = "Info"; @@ -246,15 +246,19 @@ if (!$errorOccurred && $dataPosted) // Checks if character encoding is UTF-8 if (mb_detect_encoding(implode(";", $fileRow), "UTF-8", true)) { - $rowName = $fileRow[0]; - $rowSurname = $fileRow[1]; - $rowCode = $fileRow[2]; // uid or matrikelnr - $rowStudiengang = $fileRow[3]; - $rowAmount = $fileRow[4]; - $rowDate = $fileRow[5]; + $rowSurname = $fileRow[0]; + $rowName = $fileRow[1]; + $rowGebdat = $fileRow[2]; + $rowCode = $fileRow[3]; // uid or matrikelnr + $rowStudiengang = $fileRow[4]; + $rowAmount = $fileRow[5]; + $rowIBAN = $fileRow[6]; + $rowBIC = $fileRow[7]; + $rowBank = $fileRow[8]; + $rowDate = date('Y-m-d'); // If this row is not the header - if (strtolower($rowName) != "nachname") + if (strtolower($rowSurname) != "nachname") { // If $rowCode is a matrikelnr gets the uid if (($uid = $student->getUidFromMatrikelnummer($rowCode)) === false) @@ -293,6 +297,12 @@ if (!$errorOccurred && $dataPosted) // Inserting positive amount if ($konto->save(true) === true) { + lAddToLogArray( + $L_INFO, + $lineNumber, + "Added!!!" + ); + /* Keine Gegenbuchung erstellen lDebit($konto); // Negative amount if ($konto->save(true) === true) // Inserting negative amount { @@ -310,6 +320,7 @@ if (!$errorOccurred && $dataPosted) "This file row has been discarted because an error has occurred while inserting in DB" ); } + */ } else { @@ -321,6 +332,79 @@ if (!$errorOccurred && $dataPosted) } } + // Bankverbindung hinterlegen + $bank = new bankverbindung(); + $found = false; + if($bank->load_pers($student->person_id)) + { + foreach($bank->result as $row_bank) + { + if(str_replace(' ', '', $row_bank->iban) == str_replace(' ', '', $rowIBAN)) + { + lAddToLogArray( + $L_WARNING, + $lineNumber, + "Bank IBAN already found for PersonID ".$student->person_id + ); + $found = true; + + // Update Datum aktualisieren damit Update in Fremdsystem getriggert wird + $row_bank->new=false; + $row_bank->updateamum = date('Y-m-d H:i:s'); + $row_bank->updatevon = 'Leistungsimport'; + if($row_bank->save()) + { + lAddToLogArray( + $L_INFO, + $lineNumber, + "Bank Date Update for PersonID ".$student->person_id + ); + } + else + { + lAddToLogArray( + $L_WARNING, + $lineNumber, + "Bank Date Update Failed for PersonID ".$student->person_id + ); + } + + break; + } + } + } + + if(!$found) + { + $bank = new bankverbindung(); + $bank->new = true; + $bank->iban = $rowIBAN; + $bank->person_id = $student->person_id; + $bank->bic = $rowBIC; + $bank->name = $rowBank; + $bank->typ = 'p'; + $bank->verrechnung = true; + $bank->insertamum = date('Y-m-d H:i:s'); + $bank->insertvon = 'Leistungsimport'; + $bank->updateamum = date('Y-m-d H:i:s'); + $bank->updatevon = 'Leistungsimport'; + if($bank->save()) + { + lAddToLogArray( + $L_INFO, + $lineNumber, + "Bankdaten hinzugefügt" + ); + } + else + { + lAddToLogArray( + $L_WARNING, + $lineNumber, + "Failed to Add Bankdata".$bank->errormsg + ); + } + } } else { diff --git a/vilesci/stammdaten/auswertung_fhtw.php b/vilesci/stammdaten/auswertung_fhtw.php index aa39889cb..8d928dacf 100644 --- a/vilesci/stammdaten/auswertung_fhtw.php +++ b/vilesci/stammdaten/auswertung_fhtw.php @@ -2411,12 +2411,13 @@ else }); } } - function prueflingEntSperren(person_id, name, art) + function prueflingEntSperren(element) { - if (art === true) - var text = "sperren"; - else if (art === false) - var text = "entsperren"; + var person_id = element.getAttribute("data-person-id"); + var name = element.getAttribute("data-person-name"); + var art = element.getAttribute("data-art") === "true"; + + let text = art ? "sperren" : "entsperren"; if (confirm("Wollen Sie den Studenten "+ name + " wirklich " + text + "?")) { @@ -3279,10 +3280,18 @@ else echo " - + - + ";