diff --git a/README.md b/README.md index d5620010a..c5212a353 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # FH-Complete * [FH-Complete Homepage](https://www.fhcomplete.org) -* [Wiki](https://wiki.fhcomplete.org/) +* [Wiki](https://wiki.fhcomplete.info/) * [Changelog](CHANGELOG.md) diff --git a/application/controllers/lehre/Pruefungsprotokoll.php b/application/controllers/lehre/Pruefungsprotokoll.php index 467a7dc71..21f50acca 100644 --- a/application/controllers/lehre/Pruefungsprotokoll.php +++ b/application/controllers/lehre/Pruefungsprotokoll.php @@ -220,7 +220,7 @@ class Pruefungsprotokoll extends Auth_Controller $nullfields = array('uhrzeit', 'endezeit', 'abschlussbeurteilung_kurzbz', 'protokoll'); foreach ($data as $idx => $item) { - if (in_array($idx, $nullfields) & $item === '') + if (in_array($idx, $nullfields) && $item === '') $data[$idx] = null; } diff --git a/application/libraries/LDAPLib.php b/application/libraries/LDAPLib.php index 57c8902b5..a119af51e 100644 --- a/application/libraries/LDAPLib.php +++ b/application/libraries/LDAPLib.php @@ -167,7 +167,7 @@ class LDAPLib } // LDAP connection - $ldapConnection = @ldap_connect($ldapConfigs[self::SERVER], $ldapConfigs[self::PORT]); + $ldapConnection = @ldap_connect($ldapConfigs[self::SERVER].':'.$ldapConfigs[self::PORT]); if ($ldapConnection) // if success { // Sets the LDAP protocol version diff --git a/application/models/education/Projektbetreuer_model.php b/application/models/education/Projektbetreuer_model.php index 746e4c052..4da88e344 100644 --- a/application/models/education/Projektbetreuer_model.php +++ b/application/models/education/Projektbetreuer_model.php @@ -41,4 +41,23 @@ class Projektbetreuer_model extends DB_Model return error ('Incorrect parameter type'); } } + + /** + * Get Projektbetreuer data by authentification token + * @param $zugangstoken + * @return object + */ + public function getBetreuerByToken($zugangstoken) + { + $qry = ' + SELECT tbl_projektbetreuer.person_id, tbl_projektbetreuer.projektarbeit_id, student_uid + FROM lehre.tbl_projektbetreuer + JOIN lehre.tbl_projektarbeit USING (projektarbeit_id) + WHERE zugangstoken = ? AND zugangstoken_gueltigbis >= NOW() + ORDER BY tbl_projektbetreuer.insertamum DESC, projektarbeit_id DESC + LIMIT 1 + '; + + return $this->execQuery($qry, array($zugangstoken)); + } } diff --git a/application/models/person/Benutzer_model.php b/application/models/person/Benutzer_model.php index c1e76ce38..eff1329a6 100644 --- a/application/models/person/Benutzer_model.php +++ b/application/models/person/Benutzer_model.php @@ -13,6 +13,11 @@ class Benutzer_model extends DB_Model $this->hasSequence = false; } + /** + * Gets active Benutzer from person_id + * @param $person_id + * @return object + */ public function getFromPersonId($person_id) { return $this->loadWhere(array('person_id' => $person_id, 'aktiv' => true)); diff --git a/application/widgets/Nation_widget.php b/application/widgets/Nation_widget.php index 94a028ba7..7e0c9d47b 100644 --- a/application/widgets/Nation_widget.php +++ b/application/widgets/Nation_widget.php @@ -6,7 +6,7 @@ class Nation_widget extends DropdownWidget { // Nation $this->load->model('codex/Nation_model', 'NationModel'); - $this->NationModel->addOrder('nation_code'); + $this->NationModel->addOrder('kurztext'); $this->addSelectToModel($this->NationModel, 'nation_code', 'kurztext'); diff --git a/cis/private/lehre/abgabe_lektor_details.php b/cis/private/lehre/abgabe_lektor_details.php index 7022ead1f..6b6b5633b 100644 --- a/cis/private/lehre/abgabe_lektor_details.php +++ b/cis/private/lehre/abgabe_lektor_details.php @@ -35,6 +35,8 @@ require_once('../../../include/datum.class.php'); require_once('../../../include/mail.class.php'); require_once('../../../include/phrasen.class.php'); require_once('../../../include/projektarbeit.class.php'); +require_once('../../../include/projektbetreuer.class.php'); +require_once('../../../include/sancho.inc.php'); if (!$db = new basis_db()) $db=false; @@ -116,6 +118,68 @@ if($projektarbeit_id==-1) if(!$projektarbeit_obj->load($projektarbeit_id)) die('Fehler beim Laden der Projektarbeit'); $titel = $projektarbeit_obj->titel; +$student_uid = $projektarbeit_obj->student_uid; + +// paarbeit sollte nur ab SS2021 online bewertet werden +$qry_sem="SELECT 1 + FROM lehre.tbl_projektarbeit + JOIN lehre.tbl_lehreinheit USING(lehreinheit_id) + JOIN public.tbl_studiensemester USING(studiensemester_kurzbz) + WHERE projektarbeit_id=".$db->db_add_param($projektarbeit_id, FHC_INTEGER)." + AND tbl_studiensemester.start::date >= (SELECT start FROM public.tbl_studiensemester WHERE studiensemester_kurzbz = 'SS2021')::date + LIMIT 1"; +$result_sem=$db->db_query($qry_sem); +$num_rows_sem = $db->db_num_rows($result_sem); +if($num_rows_sem < 0) +{ + echo "".$p->t('abgabetool/fehlerAktualitaetProjektarbeit')."
 "; +} + +// Zweitbegutachter holen +if($betreuerart=="Erstbegutachter") +{ + $projektbetreuer = new projektbetreuer(); + $alleBegutachter = $projektbetreuer->getProjektbetreuer($projektarbeit_id); + + if ($alleBegutachter) + { + $alleBegutachterResults = $projektbetreuer->result; + + foreach ($alleBegutachterResults as $begutachter) + { + if ($begutachter->betreuerart_kurzbz == "Erstbegutachter") + { + $erstbetreuer_id = $begutachter->person_id; + $zweitbegutachter = $projektbetreuer->getZweitbegutachterWithToken($erstbetreuer_id, $projektarbeit_id, $student_uid); + break; + } + } + + // Mail mit Token an Zweitbegutachter senden + if ($zweitbegutachter && $num_rows_sem >= 1 && isset($_GET['zweitbegutachtertoken'])) + { + $qry_std="SELECT * FROM campus.vw_benutzer where uid=".$db->db_add_param($uid); + if(!$result_std=$db->db_query($qry_std)) + { + echo "Student konnte nicht gefunden werden!
 "; + } + else + { + $row_std=@$db->db_fetch_object($result_std); + $mailres = sendZweitbegutachterMail($zweitbegutachter, $erstbetreuer_id, $row_std); + + if ($mailres) + { + echo "
".$p->t('abgabetool/zweitbegutachterMailGesendet', $zweitbegutachter->email)."
 "; + } + else + { + echo "".$p->t('abgabetool/fehlerMailZweitBegutachter')." Mail: ".$zweitbegutachter->email."
 "; + } + } + } + } +} echo ' @@ -124,6 +188,39 @@ echo ' '.$p->t('abgabetool/abgabetool').' + - - - + + + + + - - - - - + + + + diff --git a/content/pdfExport.php b/content/pdfExport.php index 29feeef6e..a85ebb345 100644 --- a/content/pdfExport.php +++ b/content/pdfExport.php @@ -252,7 +252,7 @@ else array('uid', 'stg_kz', 'person_id', 'id', 'prestudent_id', 'buchungsnummern', 'ss', 'abschlusspruefung_id', 'typ', 'all', 'preoutgoing_id', 'lvid', 'projekt_kurzbz', 'von', 'bis', 'stundevon', 'stundebis', 'sem', 'lehreinheit', 'mitarbeiter_uid', 'studienordnung_id', 'fixangestellt', 'standort', - 'abrechnungsmonat', 'form') + 'abrechnungsmonat', 'form', 'projektarbeit_id', 'betreuerart_kurzbz') ) ) { diff --git a/content/statistik/bewerberstatistik.php b/content/statistik/bewerberstatistik.php index 932a8c6cb..47e5dd0ec 100644 --- a/content/statistik/bewerberstatistik.php +++ b/content/statistik/bewerberstatistik.php @@ -1733,6 +1733,7 @@ else $content .= ""; $content .= ''; + $content .= "\n"; } //Aufsplittungen für Mischformen holen @@ -1744,28 +1745,32 @@ else { if ($db->db_num_rows($result) > 0) { - $content .= "

Aufsplittung Mischformen


"; - $content .= "\n - - - "; + $content .= "

"; + $content .= "

Aufsplittung Mischformen


"; + $content .= "\n
Studiengang
"; + $content .= "\n"; + $content .= "\n"; + $content .= "\n"; foreach ($studenttypes as $heading) { - $content .= ""; + $content .= "\n"; } - $content .= ""; + $content .= "\n"; + $content .= "\n\n"; //orgformheadings (VZ, BB,...) ausgeben for ($i = 0; $i < $noStudenttypes; $i++) { foreach ($orgform_arr as $row_orgform) { - $content .= ""; } } - $content .= ""; + $content .= "\n"; + $content .= "\n"; + $content .= "\n"; $sumarr = array(); @@ -1773,13 +1778,13 @@ else { $content .= "\n"; $content .= ''; - $content .= ""; + $content .= "\n"; foreach ($studenttypes as $key => $value) { foreach ($orgform_arr as $row_orgform) { $fullAlias = $key."_".mb_strtolower($row_orgform); - $content .= ""; //Summe berechnen @@ -1794,14 +1799,15 @@ else } } } - $content .= ""; + $content .= "\n"; $content .= "\n"; - $content .= ''; - $content .= ""; + $content .= ""; + $content .= ''; + $content .= "\n"; foreach ($sumarr as $sum) { - $content .= ""; + $content .= "\n"; } $content .= ""; $content .= '
Studiengang$heading$heading
 
"; + $content .= "\n"; $content .= $row_orgform; $content .= "
".mb_strtoupper($row->typ.$row->kurzbz)." ($row->kurzbzlang)".mb_strtoupper($row->typ.$row->kurzbz)." ($row->kurzbzlang)"; + $content .= "\n"; $content .= $row->{$fullAlias}; $content .= "
Summe
Summe".$sum."".$sum."
'; diff --git a/content/student/studentDBDML.php b/content/student/studentDBDML.php index a80ea171a..becb31e88 100644 --- a/content/student/studentDBDML.php +++ b/content/student/studentDBDML.php @@ -2296,8 +2296,12 @@ if(!$error) { $dokumente = explode(';',$_POST['dokumente']); $errormsg = ''; + $sonst = 0; foreach ($dokumente as $dokument_kurzbz) { + if ($dokument_kurzbz === 'Sonst' && $sonst !== 0) + continue; + if($dokument_kurzbz!='') { $dok = new dokument(); @@ -2308,6 +2312,8 @@ if(!$error) $dok->insertamum = date('Y-m-d H:i:s'); $dok->insertvon = $user; $dok->new = true; + if ($dokument_kurzbz === 'Sonst') + $sonst++; if(!$dok->save()) { @@ -2501,8 +2507,13 @@ if(!$error) { $dokumente = explode(';',$_POST['dokumente']); $errormsg = ''; + $sonst = 0; + foreach ($dokumente as $dokument_kurzbz) { + if ($dokument_kurzbz === 'Sonst' && $sonst !== 0) + continue; + if($dokument_kurzbz!='') { $dok = new dokument(); @@ -2514,6 +2525,11 @@ if(!$error) { $errormsg .= "Fehler bei $dokument_kurzbz: $dok->errormsg\n"; } + else + { + if ($dokument_kurzbz === 'Sonst') + $sonst++; + } } else { diff --git a/content/student/studentprojektarbeit.js.php b/content/student/studentprojektarbeit.js.php index ab284808e..66f52f15c 100644 --- a/content/student/studentprojektarbeit.js.php +++ b/content/student/studentprojektarbeit.js.php @@ -892,7 +892,13 @@ function StudentProjektbetreuerAuswahl() document.getElementById('student-projektbetreuer-checkbox-neu').checked=false; var gesamtkosten = StudentProjektbetreuerGesamtkosten(); - + + + if (document.getElementById('student-projektbetreuer-button-beurteilung')) + { + checkBeurteilung(); + } + // Wenn Vertragsdetails angezeigt werden if (projektarbeit_vertragsdetails_anzeigen) { //Reset attributes @@ -1122,6 +1128,12 @@ function StudentProjektbetreuerDetailDisableFields(val) document.getElementById('student-projektbetreuer-button-speichern').disabled=val; document.getElementById('student-projektbetreuer-button-neueperson').disabled=val; document.getElementById('student-projektbetreuer-button-kontaktdaten').disabled=val; + + if (document.getElementById('student-projektbetreuer-button-beurteilung') && val === true) + { + document.getElementById('student-projektbetreuer-button-beurteilung').disabled=val; + document.getElementById('student-projektbetreuer-span-beurteilung').setAttribute("value", ''); + } } // **** diff --git a/content/student/studentprojektarbeitoverlay.xul.php b/content/student/studentprojektarbeitoverlay.xul.php index fe4b8b2b9..4d8ab4835 100644 --- a/content/student/studentprojektarbeitoverlay.xul.php +++ b/content/student/studentprojektarbeitoverlay.xul.php @@ -520,7 +520,7 @@ $is_hidden = (!defined('FAS_STUDIERENDE_PROJEKTARBEIT_VERTRAGSDETAILS_ANZEIGEN') - +