From 59c2934324064074b7bb51c32b7e610845f5fa21 Mon Sep 17 00:00:00 2001 From: Stefan Puraner Date: Tue, 29 Nov 2016 07:48:47 +0100 Subject: [PATCH] bei anrechnung nach vorhergehender negativer beuteilung wird nicht mehr 'negativ' ausgegeben --- cis/private/profile/studienplan.php | 148 ++++++++++++++++------------ 1 file changed, 85 insertions(+), 63 deletions(-) diff --git a/cis/private/profile/studienplan.php b/cis/private/profile/studienplan.php index 828710599..e8580448f 100755 --- a/cis/private/profile/studienplan.php +++ b/cis/private/profile/studienplan.php @@ -291,9 +291,9 @@ if($zeugnisnote->getZeugnisnoten('',$uid,'')) foreach($zeugnisnote->result as $row_note) { if($row_note->note!='') - { + { $noten_arr[$row_note->lehrveranstaltung_id][$row_note->studiensemester_kurzbz]=$row_note->note; - } + } } } @@ -450,7 +450,15 @@ function drawTree($tree, $depth) if(!$positiv) { - echo ''.$p->t('studienplan/negativ').''; + //echo ''.$p->t('studienplan/negativ').''; + if(count($kompatibleLVs) > 0) + { + checkKompatibleLvs($kompatibleLVs, $student, $row_tree, $noten_arr, $note_pruef_arr, $p, $uid, true); + } + else + { + echo ''.$p->t('studienplan/negativ').''; + } } elseif($lvregelExists) { @@ -475,66 +483,7 @@ function drawTree($tree, $depth) //check if compatible course has grade elseif(count($kompatibleLVs) > 0) { - $positiv = false; - $found = false; - $i = 0; - while(!$found && $i < count($kompatibleLVs)) - { - foreach($kompatibleLVs as $komp) - { - - $anrechnung = new anrechnung(); - $anrechnung->getAnrechnungPrestudent($student->prestudent_id, $row_tree->lehrveranstaltung_id, $komp); - - if(count($anrechnung->result) == 1) - { - $lv = $anrechnung->result[0]->lehrveranstaltung_id_kompatibel; - if(isset($noten_arr[$lv])) - { - $positiv=false; - foreach($noten_arr[$lv] as $note) - { - if($note_pruef_arr[$note]->positiv) - $positiv=true; - } - - $found = true; - } - else - { - /* wenn zu mehreren kompatiblen lvs eine Anrechnung existiert - * darf found nicht auf false gesetzt werden wenn es zuvor bereits auf true gesetzt wurde - */ - if(!$found) - $found = false; - } - } - $i++; - } - } - - if($found) - { - if($positiv) - { - echo ''.$p->t('studienplan/abgeschlossen').''; - } - else - { - echo ''.$p->t('studienplan/negativ').''; - } - } - elseif(!$found) - { - if(!$row_tree->stpllv_pflicht) - { - echo ''.$p->t('studienplan/optional').''; - } - else - { - echo ''.$p->t('studienplan/offen').''; - } - } + checkKompatibleLvs($kompatibleLVs, $student, $row_tree, $noten_arr, $note_pruef_arr, $p, $uid); } else { @@ -708,6 +657,79 @@ function drawTree($tree, $depth) drawTree($row_tree->childs, $depth+1); } } + +function checkKompatibleLvs($kompatibleLVs, $student, $row_tree, $noten_arr, $note_pruef_arr, $p, $uid, $negativeNote= null) +{ + $positiv = false; + $found = false; + $i = 0; + while(!$found && $i < count($kompatibleLVs)) + { + foreach($kompatibleLVs as $komp) + { + + $anrechnung = new anrechnung(); + $anrechnung->getAnrechnungPrestudent($student->prestudent_id, $row_tree->lehrveranstaltung_id, $komp); + + if(count($anrechnung->result) == 1) + { + $lv = $anrechnung->result[0]->lehrveranstaltung_id_kompatibel; + if(isset($noten_arr[$lv])) + { + $positiv=false; + foreach($noten_arr[$lv] as $note) + { + if($note_pruef_arr[$note]->positiv) + $positiv=true; + } + + $found = true; + } + else + { + /* wenn zu mehreren kompatiblen lvs eine Anrechnung existiert + * darf found nicht auf false gesetzt werden wenn es zuvor bereits auf true gesetzt wurde + */ + if(!$found) + $found = false; + } + } + $i++; + } + } + + if($found) + { + if($positiv) + { + echo ''.$p->t('studienplan/abgeschlossen').''; + } + else + { + echo ''.$p->t('studienplan/negativ').''; + } + } + elseif(!$found) + { + if(!$row_tree->stpllv_pflicht) + { + echo ''.$p->t('studienplan/optional').''; + } + else + { + if(($negativeNote!= null) && ($negativeNote == true)) + { + echo ''.$p->t('studienplan/negativ').''; + } + else + { + echo ''.$p->t('studienplan/offen').''; + } + } + } +} + + echo ''; echo '

'.$p->t('studienplan/legende').':