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/controllers/lehre/lehrauftrag/Lehrauftrag.php b/application/controllers/lehre/lehrauftrag/Lehrauftrag.php index 8a096338e..0fe70a302 100644 --- a/application/controllers/lehre/lehrauftrag/Lehrauftrag.php +++ b/application/controllers/lehre/lehrauftrag/Lehrauftrag.php @@ -270,7 +270,6 @@ class Lehrauftrag extends Auth_Controller private function _sendMail($lehrvertrag_data_arr) { // Cluster data of new lehrvertraege as needed to send mail - $lehrvertrag_data_arr = $this->_cluster_newVertragData($lehrvertrag_data_arr); foreach ($lehrvertrag_data_arr as $lehrvertrag_data) { diff --git a/application/libraries/LDAPLib.php b/application/libraries/LDAPLib.php index 57c8902b5..195dddc88 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 @@ -220,7 +220,9 @@ class LDAPLib } else // Connection error { - return error(ldap_error($ldapConnection)); + return error( + 'An error occurred while connecting to the LDAP server: '.$ldapConfigs[self::SERVER].':'.$ldapConfigs[self::PORT] + ); } } } 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/views/lehre/lehrauftrag/acceptLehrauftragData.php b/application/views/lehre/lehrauftrag/acceptLehrauftragData.php index f09eb62a0..92c896ce7 100644 --- a/application/views/lehre/lehrauftrag/acceptLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/acceptLehrauftragData.php @@ -32,7 +32,7 @@ SELECT erteilt, akzeptiert, (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM public.tbl_person JOIN public.tbl_benutzer benutzer USING (person_id) @@ -48,7 +48,7 @@ SELECT ) ) AS "bestellt_von", (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM public.tbl_person JOIN public.tbl_benutzer benutzer USING (person_id) @@ -64,7 +64,7 @@ SELECT ) ) AS "erteilt_von", (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM public.tbl_person JOIN public.tbl_benutzer benutzer USING (person_id) @@ -241,7 +241,7 @@ FROM \'Betreuung\' AS "typ", (betreuerart_kurzbz || \' \' || (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM PUBLIC.tbl_person JOIN PUBLIC.tbl_benutzer USING (person_id) diff --git a/application/views/lehre/lehrauftrag/approveLehrauftragData.php b/application/views/lehre/lehrauftrag/approveLehrauftragData.php index 88b3eabd0..7c9669ae3 100644 --- a/application/views/lehre/lehrauftrag/approveLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/approveLehrauftragData.php @@ -34,7 +34,7 @@ SELECT erteilt, akzeptiert, (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM public.tbl_person JOIN public.tbl_benutzer benutzer USING (person_id) @@ -50,7 +50,7 @@ SELECT ) ) AS "bestellt_von", (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM public.tbl_person JOIN public.tbl_benutzer benutzer USING (person_id) @@ -66,7 +66,7 @@ SELECT ) ) AS "erteilt_von", (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM public.tbl_person JOIN public.tbl_benutzer benutzer USING (person_id) @@ -128,7 +128,7 @@ FROM ( SELECT /* lehrauftraege also planned with dummies, therefore personalnummer is needed */ - ma.personalnummer, + (ma.personalnummer::text), lema.lehreinheit_id, lv.lehrveranstaltung_id, lv.bezeichnung AS "lv_bezeichnung", @@ -240,7 +240,7 @@ FROM pa.lehreinheit_id, lv.lehrveranstaltung_id, lv.bezeichnung AS "lv_bezeichnung", - pa.projektarbeit_id AS "projektarbeit_id", + (pa.projektarbeit_id::text) AS "projektarbeit_id", le.studiensemester_kurzbz, stg.studiengang_kz, upper(stg.typ || stg.kurzbz) AS "stg_typ_kurzbz", @@ -249,7 +249,7 @@ FROM \'Betreuung\' AS "typ", (betreuerart_kurzbz || \' \' || (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM PUBLIC.tbl_person JOIN PUBLIC.tbl_benutzer USING (person_id) @@ -268,7 +268,7 @@ FROM ELSE (oe.organisationseinheittyp_kurzbz || \' \' || oe.bezeichnung) END AS "lv_oe_kurzbz", - (nachname || \' \' || vorname) AS "lektor", + (vorname || \' \' || nachname) AS "lektor", TRUNC(pb.stunden, 1) AS "stunden", TRUNC((pb.stunden * pb.stundensatz), 2) AS "betrag", vertrag_id, diff --git a/application/views/lehre/lehrauftrag/cancelledLehrauftragData.php b/application/views/lehre/lehrauftrag/cancelledLehrauftragData.php index 54948fb26..a3efb66b3 100644 --- a/application/views/lehre/lehrauftrag/cancelledLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/cancelledLehrauftragData.php @@ -14,7 +14,7 @@ $query = ' datum AS "storniert", ( SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM public.tbl_person JOIN public.tbl_benutzer benutzer USING (person_id) diff --git a/application/views/lehre/lehrauftrag/orderLehrauftragData.php b/application/views/lehre/lehrauftrag/orderLehrauftragData.php index aea7d5181..1ccfc55a4 100644 --- a/application/views/lehre/lehrauftrag/orderLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/orderLehrauftragData.php @@ -65,7 +65,7 @@ SELECT erteilt, akzeptiert, (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM public.tbl_person JOIN public.tbl_benutzer benutzer USING (person_id) @@ -81,7 +81,7 @@ SELECT ) ) AS "bestellt_von", (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM public.tbl_person JOIN public.tbl_benutzer benutzer USING (person_id) @@ -97,7 +97,7 @@ SELECT ) ) AS "erteilt_von", (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM public.tbl_person JOIN public.tbl_benutzer benutzer USING (person_id) @@ -281,7 +281,7 @@ FROM \'Betreuung\' AS "typ", (betreuerart_kurzbz || \' \' || (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM PUBLIC.tbl_person JOIN PUBLIC.tbl_benutzer USING (person_id) 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..9f74d5cf8 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').' + - - - + + + + + '; -?> - @@ -673,7 +726,7 @@ if($result = $db->db_query($qry)) } $content_form.= ''; $content_form.= ''.$p->t('global/bezeichnung').''; -$content_form.= ''.$p->t('global/von').' '; +$content_form.= ''.$p->t('global/von').' '; //dropdown fuer vonstunde $content_form.= $p->t('zeitsperre/stundeInklusive'); @@ -695,7 +748,7 @@ for($i=0;$i<$num_rows_stunde;$i++) $content_form.= ""; -$content_form.= ''.$p->t('global/bis').' '; +$content_form.= ''.$p->t('global/bis').' '; //dropdown fuer bisstunde $content_form.= $p->t('zeitsperre/stundeInklusive'); $content_form.= " "; + else $content_form.= ""; $content_form.= ''; $content_form .= ' '; -$content_form.= "".$p->t('zeitsperre/achtungEsWerdenAlleEingegebenenTage').""; +$content_form.= "" .$p->t('zeitsperre/achtungEsWerdenAlleEingegebenenTage').""; $content_form.= ''; echo ''; @@ -774,3 +828,4 @@ echo '
'; +showHideStudeDropDown();'; ?> diff --git a/cis/private/tools/projektabgabe.php b/cis/private/tools/projektabgabe.php index 586380bd6..06ec1e146 100644 --- a/cis/private/tools/projektabgabe.php +++ b/cis/private/tools/projektabgabe.php @@ -91,20 +91,20 @@ if($aktion!='zip') - - - - - - - + + + '; + include('../../../include/meta/jquery.php'); + include('../../../include/meta/jquery-tablesorter.php'); + echo ' diff --git a/cis/private/tools/zeitaufzeichnung.php b/cis/private/tools/zeitaufzeichnung.php index 71fdda2bb..2a7939e17 100644 --- a/cis/private/tools/zeitaufzeichnung.php +++ b/cis/private/tools/zeitaufzeichnung.php @@ -1,5 +1,5 @@ @@ -213,6 +221,7 @@ echo ' - - - - - - - -

Statistik Übersicht

-
- Neu -
'; -if(isset($_GET['action']) && $_GET['action']=='delete') -{ - if(!$rechte->isBerechtigt('basis/statistik', null, 'suid')) - die('Sie haben keine Berechtigung fuer diese Seite'); - - if(!isset($_GET['statistik_kurzbz'])) - die('Fehlender Parameter Statistik'); - - $statistik = new statistik(); - if($statistik->delete($_GET['statistik_kurzbz'])) - echo 'Eintrag wurde erfolgreich gelöscht'; - else - echo ''.$statistik->errormsg.''; -} - -$statistik = new statistik(); - -if(!$statistik->getAll()) - die($statistik->errormsg); - -echo ' - - - - - - - - - - - '; - -foreach($statistik->result as $row) -{ - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; -} -echo ' -
KurzbzBezeichnungGruppePublishContentIDAktion
',$row->statistik_kurzbz,'',$row->bezeichnung,'',$row->gruppe,'',($row->publish?'Ja':'Nein'),'',$row->content_id,'bearbeitenentfernen
- -'; -?> + + * Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at > + * Karl Burkhart < burkhart@technikum-wien.at > + */ +require_once('../../config/vilesci.config.inc.php'); +require_once('../../include/statistik.class.php'); +require_once('../../include/benutzerberechtigung.class.php'); + +$user = get_uid(); + +$rechte = new benutzerberechtigung(); +$rechte->getBerechtigungen($user); + +if(!$rechte->isBerechtigt('basis/statistik', null, 'suid')) + die('Sie haben keine Berechtigung fuer diese Seite'); + +echo ' + + + Statistik + + + + '; + + include('../../include/meta/jquery.php'); + include('../../include/meta/jquery-tablesorter.php'); + +echo ' + + + + +

Statistik Übersicht

+
+ Neu +
'; +if(isset($_GET['action']) && $_GET['action']=='delete') +{ + if(!$rechte->isBerechtigt('basis/statistik', null, 'suid')) + die('Sie haben keine Berechtigung fuer diese Seite'); + + if(!isset($_GET['statistik_kurzbz'])) + die('Fehlender Parameter Statistik'); + + $statistik = new statistik(); + if($statistik->delete($_GET['statistik_kurzbz'])) + echo 'Eintrag wurde erfolgreich gelöscht'; + else + echo ''.$statistik->errormsg.''; +} + +$statistik = new statistik(); + +if(!$statistik->getAll()) + die($statistik->errormsg); + +echo ' + + + + + + + + + + + '; + +foreach($statistik->result as $row) +{ + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; +} +echo ' +
KurzbzBezeichnungGruppePublishContentIDAktion
',$row->statistik_kurzbz,'',$row->bezeichnung,'',$row->gruppe,'',($row->publish?'Ja':'Nein'),'',$row->content_id,'bearbeitenentfernen
+ +'; +?>