diff --git a/application/controllers/api/frontend/v1/Noten.php b/application/controllers/api/frontend/v1/Noten.php
index 4655fcc71..f8bbc966b 100644
--- a/application/controllers/api/frontend/v1/Noten.php
+++ b/application/controllers/api/frontend/v1/Noten.php
@@ -46,7 +46,10 @@ class Noten extends FHCAPI_Controller
// Loads phrases system
$this->loadPhrases([
'global',
- 'benotungstool'
+ 'person',
+ 'benotungstool',
+ 'lehre',
+ 'ui'
]);
require_once(FHCPATH . 'include/mobilitaet.class.php');
@@ -70,9 +73,6 @@ class Noten extends FHCAPI_Controller
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
// todo: check various other berechtigungen if its mitarbeiter/lektor/zugeteilterLektor?
-
-
-
// get studenten for lva & sem with zeugnisnote if available
$studenten = $this->LehrveranstaltungModel->getStudentsByLv($sem_kurzbz, $lv_id);
$studentenData = $this->getDataOrTerminateWithError($studenten);
@@ -91,10 +91,6 @@ class Noten extends FHCAPI_Controller
foreach($student_uids as $uid) {
$grades[$uid]['grades'] = [];
-
-// $student = new student();
-// $student->load($uid);
-// $student->result[]= $student;
$res = $this->StudentModel->load([$uid]);
$this->addMeta($uid, $res);
@@ -279,16 +275,19 @@ class Noten extends FHCAPI_Controller
}
$betreff = 'Notenfreigabe ' . $lv->bezeichnung . ' ' . $lv->orgform_kurzbz . ' - ' . $studienplan_bezeichnung;
- $studlist = "
- | " . $this->p->t('global','personenkz') . " |
- " . $this->p->t('global','studiengang') . " |
- " . $this->p->t('global','nachname') . " |
- " . $this->p->t('global','vorname') . " |
- ";
- $studlist .= "" . $this->p->t('benotungstool','note') . " | ";
- $studlist .= "" . $this->p->t('benotungstool','bearbeitetvon') . " |
";
-
+ $studlist = "";
+ if (defined('CIS_GESAMTNOTE_FREIGABEMAIL_NOTE') && CIS_GESAMTNOTE_FREIGABEMAIL_NOTE) {
+ $studlist .= "| " . $this->p->t('person','personenkennzeichen') . " | \n
+ " . $this->p->t('lehre','studiengang') . " | \n
+ " . $this->p->t('benotungstool','c4nachname') . " | \n
+ " . $this->p->t('benotungstool','c4vorname') . " | \n";
+ $studlist .= "" . $this->p->t('benotungstool','c4grade') . " | \n";
+ $studlist .= "" . $this->p->t('ui','bearbeitetVon') . " |
\n";
+ } else {
+ $studlist .= "" . $this->p->t('person','uid') . " | \n";
+ }
+
foreach($result->noten as $note) {
$resultLVGes = $this->LvgesamtnoteModel->getLvGesamtNoten($lv_id, $note->uid, $sem_kurzbz);
@@ -318,45 +317,40 @@ class Noten extends FHCAPI_Controller
$ret[] = array('uid' => $note->uid, 'freigabedatum' => $lvgesamtnote->freigabedatum, 'benotungsdatum' => $lvgesamtnote->benotungsdatum);
}
}
-
- // TODO: find the real config for that
- // defined('CIS_GESAMTNOTE_FREIGABEMAIL_NOTE') && CIS_GESAMTNOTE_FREIGABEMAIL_NOTE
- if (true)
+
+ if (defined('CIS_GESAMTNOTE_FREIGABEMAIL_NOTE') && CIS_GESAMTNOTE_FREIGABEMAIL_NOTE)
{
$studlist .= "| " . trim($note->matrikelnr) . " | ";
- $studlist .= "
| " . trim($note->kuerzel) . " | ";
- $studlist .= "
| " . trim($note->nachname) . " | ";
- $studlist .= "
| " . trim($note->vorname) . " | ";
+ $studlist .= "" . trim($note->kuerzel) . " | ";
+ $studlist .= "" . trim($note->nachname) . " | ";
+ $studlist .= "" . trim($note->vorname) . " | ";
// TODO: if defined(CIS_PUNKTE) ...
-
- // TODO: note bezeichnung
- $studlist .= "" .$note->note. " | ";
+ $studlist .= "" .$note->noteBezeichnung. " | ";
$studlist .= "" . $lvgesamtnote->mitarbeiter_uid;
-// if ($lvgesamtnote->updatevon != '')
-// $studlist .= " (" . $lvgesamtnote->updatevon . ")";
+ if ($lvgesamtnote->updatevon != '')
+ $studlist .= " (" . $lvgesamtnote->updatevon . ")";
$studlist .= " |
";
+ } else {
+ $studlist .= "| " . trim($note->uid) . " |
\n";
}
}
}
}
$studlist .= "
";
- // TODO: find the real config for that
- // defined('CIS_GESAMTNOTE_FREIGABEMAIL_NOTE') && CIS_GESAMTNOTE_FREIGABEMAIL_NOTE
- if (true)
- {
- $this->sendEmail($lektorFullName, $lvaFullName, count($result->noten), $emails, $studlist, $betreff);
- }
-
- $this->addMeta('studlist', $studlist);
+ // always send the mail, config toggles data contents
+ $this->sendEmail($lektorFullName, $lvaFullName, count($result->noten), $emails, $studlist, $betreff);
$this->terminateWithSuccess($ret);
}
private function sendEmail($lektorFullName, $lvaFullName, $notenCount, $emailAdressen, $studlist, $betreff)
{
+ $emailAdressen[] = getAuthUID() . "@" . DOMAIN; // also send mail to lektors own adress
+ $adressen = implode(";", $emailAdressen);
+
foreach ($emailAdressen as $email)
{
// Prepare mail content
@@ -364,8 +358,8 @@ class Noten extends FHCAPI_Controller
'lektor' => $lektorFullName,
'lvaname' => $lvaFullName,
'studlist' => $studlist,
- 'notencount' => $notenCount,
- 'adressen' => $emailAdressen
+ 'neuenotencount' => $notenCount,
+ 'adressen' => $adressen
);
// Send mail
diff --git a/public/js/components/Cis/Benotungstool/Benotungstool.js b/public/js/components/Cis/Benotungstool/Benotungstool.js
index b13239c12..2cdfad4a2 100644
--- a/public/js/components/Cis/Benotungstool/Benotungstool.js
+++ b/public/js/components/Cis/Benotungstool/Benotungstool.js
@@ -79,7 +79,7 @@ export const Benotungstool = {
this.selectedUids = data.filter(d => d.selectable);
}
},
- {
+ {
event: "cellEdited",
handler: async (cell) => {
const field = cell.getField()
@@ -101,7 +101,7 @@ export const Benotungstool = {
row.reformat() // trigger reformat of arrow
}
}
- }
+ },
]};
},
methods: {
@@ -428,6 +428,7 @@ export const Benotungstool = {
return true; // student can be selected to add pruefung
},
rowFormatter: this.fixTabulatorSelectionFormatter,
+ debugEventsExternal:true,
columns: [
{
formatter: function (cell, formatterParams, onRendered) {
@@ -1481,6 +1482,11 @@ export const Benotungstool = {
const cs = this.studenten ? this.studenten.reduce((acc, cur) => {
const teilnote = this.teilnoten[cur.uid]
if(teilnote.note_lv && (cur.benotungsdatum > cur.freigabedatum)) {
+
+ // write noteBezeichnung into changed Note so we can send emails in backend easier...
+ const opt = this.notenOptions.find(opt => opt.note == cur.lv_note)
+ cur.noteBezeichnung = opt.bezeichnung
+
acc.push(cur)
}
return acc