From 8d5742136c09f096064052d435543642c2639edf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Tue, 28 May 2019 18:37:21 +0200 Subject: [PATCH] Gradelist - added additional Informations for courses - only display courses where the person is assigned to - added SWS Sum - Improved Multilanguage support --- application/controllers/person/Gradelist.php | 71 ++++++++- application/libraries/StudienplanLib.php | 8 +- application/views/person/gradelist/course.php | 20 ++- .../views/person/gradelist/gradelist.php | 6 +- .../views/person/gradelist/semester.php | 47 ++++-- public/css/tools/gradelist.css | 2 + system/phrasesupdate.php | 149 +++++++++++++++++- 7 files changed, 276 insertions(+), 27 deletions(-) diff --git a/application/controllers/person/Gradelist.php b/application/controllers/person/Gradelist.php index 70913061b..e1ef14792 100644 --- a/application/controllers/person/Gradelist.php +++ b/application/controllers/person/Gradelist.php @@ -28,6 +28,7 @@ class Gradelist extends Auth_Controller $this->load->model('education/zeugnisnote_model', 'ZeugnisnoteModel'); $this->load->model('education/lehrveranstaltung_model', 'LehrveranstaltungModel'); $this->load->model('codex/note_model', 'NoteModel'); + $this->load->model('education/lehrveranstaltung_model', 'LehrveranstaltungModel'); $this->loadPhrases( array( @@ -163,6 +164,14 @@ class Gradelist extends Auth_Controller 'studienplan_bezeichnung' => $stpl_bezeichnung, ); } + $result_zuordnung = $this->LehrveranstaltungModel->getLvsByStudent($uid, $row_status->studiensemester_kurzbz); + if(isSuccess($result_zuordnung) && hasData($result_zuordnung)) + { + $this->setZuordnung( + $result_zuordnung, + $courses['semester'][$row_status->studiensemester_kurzbz]['lvs'] + ); + } } // Load Grades and add to studyplan @@ -186,6 +195,7 @@ class Gradelist extends Auth_Controller if (!isset($row_noten->found)) { $result_lv = $this->LehrveranstaltungModel->load($row_noten->lehrveranstaltung_id); + $result_stg = $this->StudiengangModel->load($result_lv->retval[0]->studiengang_kz); $courses['semester'][$row_noten->studiensemester_kurzbz]['lvs_nonstpl'][] = array( 'lehrveranstaltung_id' => $row_noten->lehrveranstaltung_id, 'lehrtyp_kurzbz' => $result_lv->retval[0]->lehrtyp_kurzbz, @@ -194,13 +204,20 @@ class Gradelist extends Auth_Controller 'sws' => $result_lv->retval[0]->sws, 'zeugnis' => $result_lv->retval[0]->zeugnis, 'bezeichnung' => $result_lv->retval[0]->bezeichnung, + 'kurzbz' => $result_lv->retval[0]->kurzbz, 'ects' => $result_lv->retval[0]->ects, + 'semester' => $result_lv->retval[0]->semester, 'note' => $row_noten->note, - 'datum' => $row_noten->benotungsdatum + 'datum' => $row_noten->benotungsdatum, + 'zugeordnet' => true, + 'studiengang_kurzbz' => $result_stg->retval[0]->kurzbzlang ); if(!isset($courses['semester'][$row_noten->studiensemester_kurzbz]['data']['ectssumme_nonstpl'])) $courses['semester'][$row_noten->studiensemester_kurzbz]['data']['ectssumme_nonstpl'] = 0; + if(!isset($courses['semester'][$row_noten->studiensemester_kurzbz]['data']['swssumme_nonstpl'])) + $courses['semester'][$row_noten->studiensemester_kurzbz]['data']['swssumme_nonstpl'] = 0; $courses['semester'][$row_noten->studiensemester_kurzbz]['data']['ectssumme_nonstpl'] += $result_lv->retval[0]->ects; + $courses['semester'][$row_noten->studiensemester_kurzbz]['data']['swssumme_nonstpl'] += $result_lv->retval[0]->sws; } } @@ -210,6 +227,8 @@ class Gradelist extends Auth_Controller $num_grades_overall = 0; $sum_ects_overall = 0; $sum_ects_positiv_overall = 0; + $sum_sws_overall = 0; + $sum_sws_positiv_overall = 0; // Calculate Sum and Average foreach ($courses['semester'] as $stsem => $row_lvs) @@ -219,6 +238,8 @@ class Gradelist extends Auth_Controller $num_grades = 0; $sum_ects = 0; $sum_ects_positiv = 0; + $sum_sws = 0; + $sum_sws_positiv = 0; $sum_grades = 0; $notendurchschnitt = 0; $sum_gradeweighted = 0; @@ -235,8 +256,12 @@ class Gradelist extends Auth_Controller $sum_gradeweighted += $row['ects'] * $this->_grades[$row['note']]['notenwert']; } $sum_ects += $row['ects']; + $sum_sws += $row['sws']; if ($this->_grades[$row['note']]['positiv']) + { $sum_ects_positiv += $row['ects']; + $sum_sws_positiv += $row['sws']; + } } if ($num_grades > 0) $notendurchschnitt = $sum_grades / $num_grades; @@ -254,11 +279,15 @@ class Gradelist extends Auth_Controller $sum_ectsweighted_overall += $sum_ectsweighted; $sum_ects_overall += $sum_ects; $sum_ects_positiv_overall += $sum_ects_positiv; + $sum_sws_overall += $sum_sws; + $sum_sws_positiv_overall += $sum_sws_positiv; $courses['semester'][$stsem]['data']['notendurchschnitt'] = number_format($notendurchschnitt, 2); $courses['semester'][$stsem]['data']['notendurchschnittgewichtet'] = number_format($notendurchschnittgewichtet, 2); $courses['semester'][$stsem]['data']['ectssumme'] = number_format($sum_ects,2); - $courses['semester'][$stsem]['data']['ectssumme_positiv'] = number_formaT($sum_ects_positiv,2); + $courses['semester'][$stsem]['data']['ectssumme_positiv'] = number_format($sum_ects_positiv,2); + $courses['semester'][$stsem]['data']['swssumme'] = number_format($sum_sws,2); + $courses['semester'][$stsem]['data']['swssumme_positiv'] = number_format($sum_sws_positiv,2); } if ($num_grades_overall > 0) @@ -275,7 +304,9 @@ class Gradelist extends Auth_Controller 'notendurchschnitt' => number_format($notendurchschnitt, 2), 'notendurchschnittgewichtet' => number_format($notendurchschnittgewichtet, 2), 'ectssumme' => $sum_ects_overall, - 'ectssumme_positiv' => $sum_ects_positiv_overall + 'ectssumme_positiv' => $sum_ects_positiv_overall, + 'swssumme' => $sum_sws_overall, + 'swssumme_positiv' => $sum_sws_positiv_overall ); return $courses; } @@ -306,6 +337,37 @@ class Gradelist extends Auth_Controller } } + /** + * Checks if the Student is Assigned to this course and marks the course + * @param $zuordnung reference to array of all assigned courses. + * @param $courses reference to array of all courses. + * @param $studiensemester_kurzbz Studiensemester of the Course and Grades + */ + private function setZuordnung(&$zuordnung, &$courses) + { + $subtree_zugeordnet = false; + foreach ($courses as $key => $value) + { + foreach ($zuordnung->retval as $zuordnungkey => $row_zuordnung) + { + if ($row_zuordnung->lehrveranstaltung_id == $value['lehrveranstaltung_id']) + { + $courses[$key]['zugeordnet'] = true; + $subtree_zugeordnet = true; + } + if (isset($value['childs'])) + { + if ($this->setZuordnung($zuordnung, $courses[$key]['childs']) === true) + { + $courses[$key]['zugeordnet'] = true; + $subtree_zugeordnet = true; + } + } + } + } + return $subtree_zugeordnet; + } + /** * Reads all the Courses recursivly and Returns an Array with the Grades and ECTS * @param $courses array of courses @@ -320,7 +382,8 @@ class Gradelist extends Auth_Controller { $grades[] = array( 'note' => $row['note'], - 'ects' => $row['ects'] + 'ects' => $row['ects'], + 'sws' => $row['sws'] ); } diff --git a/application/libraries/StudienplanLib.php b/application/libraries/StudienplanLib.php index ecc66e5bf..1b393a8e9 100644 --- a/application/libraries/StudienplanLib.php +++ b/application/libraries/StudienplanLib.php @@ -37,7 +37,9 @@ class StudienplanLib 'pflicht' => $row->pflicht, 'zeugnis' => $row->zeugnis, 'bezeichnung' => $row->bezeichnung, - 'ects' => $row->ects + 'kurzbz' => $row->kurzbz, + 'ects' => $row->ects, + 'semester' => $row->semester ); $childs = $this->getChildElements($row->studienplan_lehrveranstaltung_id); if(is_array($childs) && count($childs) > 0) @@ -65,7 +67,9 @@ class StudienplanLib 'pflicht' => $row->pflicht, 'zeugnis' => $row->zeugnis, 'bezeichnung' => $row->bezeichnung, - 'ects' => $row->ects + 'kurzbz' => $row->kurzbz, + 'ects' => $row->ects, + 'semester' => $row->semester ); $childs = $this->getChildElements($row->studienplan_lehrveranstaltung_id); if(is_array($childs)) diff --git a/application/views/person/gradelist/course.php b/application/views/person/gradelist/course.php index 4b4b41d0f..a4dfaa0fb 100644 --- a/application/views/person/gradelist/course.php +++ b/application/views/person/gradelist/course.php @@ -3,16 +3,27 @@ if(isset($course['note']) && isset($grades[$course['note']])) $gradeclass = ($grades[$course['note']]['positiv']?'gradelist_row_grade_positiv':'gradelist_row_grade_negativ'); else $gradeclass = ''; + +// Only Display the Course if the person is assigned to the course +// (no additional elective courses are displayed) +if(isset($course['zugeordnet']) && $course['zugeordnet'] === true) +{ ?> + + + + - + diff --git a/application/views/person/gradelist/gradelist.php b/application/views/person/gradelist/gradelist.php index c6aaaa2f8..dbdcf66f8 100644 --- a/application/views/person/gradelist/gradelist.php +++ b/application/views/person/gradelist/gradelist.php @@ -31,9 +31,11 @@
- p->t('lehre', 'notendurchschnitt'); ?>: + p->t('lehre', 'notendurchschnitt'); ?> + :
- p->t('lehre', 'gewichteternotendurchschnitt'); ?>: + p->t('lehre', 'gewichteternotendurchschnitt'); ?> + :
p->t('lehre', 'ects'); ?>:
diff --git a/application/views/person/gradelist/semester.php b/application/views/person/gradelist/semester.php index d78e19342..e3614744f 100644 --- a/application/views/person/gradelist/semester.php +++ b/application/views/person/gradelist/semester.php @@ -38,13 +38,13 @@ p->t('lehre','lehrveranstaltung');?> + p->t('lehre','kurzbz');?> + p->t('lehre','semester');?> + p->t('lehre','lehrform');?> p->t('lehre','ects');?> - + p->t('lehre','sws');?> + p->t('lehre','pflichtfach');?> + p->t('lehre','zeugnis');?> p->t('lehre','note');?> @@ -58,6 +58,9 @@ + + + + + + + + @@ -84,13 +101,13 @@ p->t('lehre','lehrveranstaltung');?> + p->t('lehre','kurzbz');?> + p->t('lehre','semester');?> + p->t('lehre','lehrform');?> p->t('lehre','ects');?> - + p->t('lehre','sws');?> + p->t('lehre','pflichtfach');?> + p->t('lehre','zeugnis');?> p->t('lehre','note');?> @@ -107,8 +124,14 @@ + + + + + + diff --git a/public/css/tools/gradelist.css b/public/css/tools/gradelist.css index 68c7fff36..776c3cf7d 100644 --- a/public/css/tools/gradelist.css +++ b/public/css/tools/gradelist.css @@ -16,9 +16,11 @@ .gradelist_row_grade_positiv { color: green; + font-weight: bold; } .gradelist_row_grade_negativ { color: red; + font-weight: bold; } .gradelist_row_depth_1 > td:first-child { padding-left: 15px !important; diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index bd28b2bd6..4f5145034 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -2223,6 +2223,66 @@ $phrases = array( ) ) ), + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'sws', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'SWS', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'SP/W', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'pflichtfach', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Pflichtfach', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Mandatory', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'zeugnis', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Zeugnis', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Transcript', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'lehre', @@ -2303,6 +2363,46 @@ $phrases = array( ) ) ), + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'kurzbz', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Kurzbz', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'ShortDesc', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'semester', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Semester', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Semester', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'lehre', @@ -2314,16 +2414,57 @@ $phrases = array( 'text' => 'Nicht studienplanrelevante Lehrveranstaltung', 'description' => '', 'insertvon' => 'system' - ), + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'info_notendurchschnitt', + 'insertvon' => 'system', + 'phrases' => array( array( - 'sprache' => 'English', - 'text' => 'additional Courses', + 'sprache' => 'German', + 'text' => 'Notendurchschnitt über alle Noten (inkl. negative)', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'info_notendurchschnitt_gewichtet', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Notendurchschnitt über alle Noten (inkl. negative) gewichtet nach ECTS der LV. = (Summe (Note der LV * ECTS der LV))/Gesamtsumme der ECTS', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'lehrform', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Lehrform', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Course Type', 'description' => '', 'insertvon' => 'system' ) ) ), - //********************** INFOCENTER/infocenter array( 'app' => 'infocenter',