diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index 0f6e2d5ae..f00cac01b 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -184,6 +184,77 @@ class AnrechnungLib return $result; } + /** + * Get Empfehlung data object. + * @param $anrechnung_id + * @return array + * @throws Exception + */ + public function getEmpfehlungData($anrechnung_id) + { + if (!is_numeric($anrechnung_id)) + { + show_error('Incorrect parameter'); + } + + $empfehlung_data = new stdClass(); + $empfehlung_data->empfehlung = null; + $empfehlung_data->empfehlung_von = '-'; + $empfehlung_data->empfehlung_am = '-'; + $empfehlung_data->notiz = ''; // Begruendung, if not recommended + + + if(!$anrechnung = getData($this->ci->AnrechnungModel->load($anrechnung_id))[0]) + { + show_error('Failed loading Anrechnung'); + } + + if (is_null($anrechnung->empfehlung_anrechnung)) + { + return success($empfehlung_data); + } + + // If Empfehlung is true or false + if (!is_null($anrechnung->empfehlung_anrechnung)) + { + // Get last lector and date, where recommendation was given + $result = $this->ci->AnrechnungModel->getLastAnrechnungstatus( + $anrechnung_id, + self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR + ); + if ($result = getData($result)[0]) + { + $empfehlung_datum = (new DateTime($result->insertamum))->format('d.m.Y'); + } + + // Get full name of lector + $result = $this->ci->PersonModel->getByUID($result->insertvon); + if ($result = getData($result)[0]) + { + $empfehlung_von = $result->vorname. ' '. $result->nachname; + } + + $empfehlung_data->empfehlung = $anrechnung->empfehlung_anrechnung; + $empfehlung_data->empfehlung_von = $empfehlung_von; + $empfehlung_data->empfehlung_am = $empfehlung_datum; + } + + // If Empfehlung is false, retrieve also Notiz with Begruendung + if (!$anrechnung->empfehlung_anrechnung) + { + // Get Ablehnungsbegruendung (only set, if Anrechnung was not recommended yet) + $this->ci->load->model('person/Notiz_model', 'NotizModel'); + $result = $this->ci->NotizModel->getNotizByAnrechnung($anrechnung_id, self::ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_LEKTOR); + if ($notiz = getData($result)[0]) + { + $empfehlung_data->notiz = $notiz->text; + } + } + + return success($empfehlung_data); + + } + /** * Get last Anrechnungstatusbezeichnung in users language. * @param $anrechnung_id diff --git a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php index 7a22abcc1..7b8d29d4c 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php @@ -4,6 +4,7 @@ $this->load->view( array( 'title' => $this->p->t('anrechnung', 'anrechnungenPruefen'), 'jquery' => true, + 'jqueryui' => true, 'bootstrap' => true, 'fontawesome' => true, 'ajaxlib' => true, @@ -29,9 +30,12 @@ $this->load->view( 'lektor', ) ), + 'customCSSs' => array( + 'public/css/Tabulator.css' + ), 'customJSs' => array( 'public/js/bootstrapper.js', - 'public/js/lehre/anrechnung/reviewAnrechnung.js' + 'public/js/lehre/anrechnung/reviewAnrechnungDetail.js' ) ) @@ -55,83 +59,172 @@ $this->load->view(
| p->t('person', 'student'); ?> | +vorname . ' ' . $antragData->nachname; ?> | +
| p->t('person', 'personenkennzeichen'); ?> | +matrikelnr ?> | +
| p->t('lehre', 'studiensemester'); ?> | +studiensemester_kurzbz ?> | +
| p->t('lehre', 'studiengang'); ?> | +stg_bezeichnung ?> | +
| p->t('lehre', 'lehrveranstaltung'); ?> | +lv_bezeichnung ?> | +
| p->t('lehre', 'ects'); ?> | +ects ?> | +
| p->t('lehre', 'lektorInnen'); ?> | ++ lektoren) - 1 ?> + lektoren as $key => $lektor): ?> + vorname . ' ' . $lektor->nachname; + echo $key === $len ? '' : ', ' ?> + + | +
| p->t('anrechnung', 'herkunftDerKenntnisse'); ?> | +anmerkung ?> | +
| p->t('anrechnung', 'nachweisdokumente'); ?> | ++ dokumentname ?> + | +