diff --git a/application/controllers/api/frontend/v1/Abgabe.php b/application/controllers/api/frontend/v1/Abgabe.php index af598a345..db182eb3a 100644 --- a/application/controllers/api/frontend/v1/Abgabe.php +++ b/application/controllers/api/frontend/v1/Abgabe.php @@ -846,9 +846,11 @@ class Abgabe extends FHCAPI_Controller private function getProjektbetreuerEmailByProjektarbeitID($projektarbeit_id) { $this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel'); $result = $this->ProjektarbeitModel->getProjektbetreuerEmail($projektarbeit_id); - $email = $this->getDataOrTerminateWithError($result, 'general'); - - return $email[0]->uid ? $email[0]->uid.'@'.DOMAIN : $email[0]->private_email; + + if(count($result->retval) > 0) { + $email = getData($result); + return $email[0]->uid ? $email[0]->uid.'@'.DOMAIN : $email[0]->private_email; + } else return ''; } diff --git a/application/models/education/Projektarbeit_model.php b/application/models/education/Projektarbeit_model.php index 726bb70a7..a07bcec42 100644 --- a/application/models/education/Projektarbeit_model.php +++ b/application/models/education/Projektarbeit_model.php @@ -480,7 +480,7 @@ class Projektarbeit_model extends DB_Model LEFT JOIN public.tbl_benutzer student_benutzer ON (student_benutzer.uid = lehre.tbl_projektarbeit.student_uid) LEFT JOIN public.tbl_person student_person ON (student_benutzer.person_id = student_person.person_id) LEFT JOIN public.tbl_student on(student_benutzer.uid = public.tbl_student.student_uid) - LEFT JOIN lehre.tbl_lehrveranstaltung ON (lehrveranstaltung_id) + LEFT JOIN lehre.tbl_lehrveranstaltung USING (lehrveranstaltung_id) LEFT JOIN public.tbl_studiengang ON (public.tbl_student.studiengang_kz = public.tbl_studiengang.studiengang_kz) LEFT JOIN lehre.tbl_projekttyp USING (projekttyp_kurzbz) LEFT JOIN lehre.tbl_projektbetreuer USING (projektarbeit_id) diff --git a/include/projektarbeit.class.php b/include/projektarbeit.class.php index c191550b7..c933e727d 100644 --- a/include/projektarbeit.class.php +++ b/include/projektarbeit.class.php @@ -37,6 +37,8 @@ class projektarbeit extends basis_db public $titel; // string public $titel_english; // string public $lehreinheit_id; // integer + public $lehrveranstaltung_id; // integer + public $studiensemester_kurzbz; // string public $student_uid; // integer public $firma_id; // integer public $note; // integer @@ -129,6 +131,8 @@ class projektarbeit extends basis_db $this->titel = $row->titel; $this->titel_english = $row->titel_english; $this->lehreinheit_id = $row->lehreinheit_id; + $this->lehrveranstaltung_id = $row->lehrveranstaltung_id; + $this->studiensemester_kurzbz = $row->studiensemester_kurzbz; $this->student_uid = $row->student_uid; $this->firma_id = $row->firma_id; $this->note = $row->note; @@ -261,12 +265,15 @@ class projektarbeit extends basis_db { //Neuen Datensatz einfuegen - $qry='BEGIN; INSERT INTO lehre.tbl_projektarbeit (projekttyp_kurzbz, titel, lehreinheit_id, student_uid, firma_id, note, punkte, + $qry='BEGIN; INSERT INTO lehre.tbl_projektarbeit (projekttyp_kurzbz, titel, lehreinheit_id, + lehrveranstaltung_id, studiensemester_kurzbz, student_uid, firma_id, note, punkte, beginn, ende, faktor, freigegeben, gesperrtbis, stundensatz, gesamtstunden, themenbereich, anmerkung, insertamum, insertvon, updateamum, updatevon, titel_english, final) VALUES('. $this->db_add_param($this->projekttyp_kurzbz).', '. $this->db_add_param($this->titel).', '. $this->db_add_param($this->lehreinheit_id, FHC_INTEGER).', '. + $this->db_add_param($this->lehrveranstaltung_id, FHC_INTEGER).', '. + $this->db_add_param($this->studiensemester_kurzbz).', '. $this->db_add_param($this->student_uid).', '. $this->db_add_param($this->firma_id, FHC_INTEGER).', '. $this->db_add_param($this->note).', '. @@ -301,6 +308,8 @@ class projektarbeit extends basis_db 'titel='.$this->db_add_param($this->titel).', '. 'titel_english='.$this->db_add_param($this->titel_english).', '. 'lehreinheit_id='.$this->db_add_param($this->lehreinheit_id, FHC_INTEGER).', '. + 'lehrveranstaltung_id='.$this->db_add_param($this->lehrveranstaltung_id, FHC_INTEGER).', '. + 'studiensemester_kurzbz='.$this->db_add_param($this->studiensemester_kurzbz).', '. 'student_uid='.$this->db_add_param($this->student_uid).', '. 'firma_id='.$this->db_add_param($this->firma_id, FHC_INTEGER).', '. 'note='.$this->db_add_param($this->note).', '. @@ -406,6 +415,8 @@ class projektarbeit extends basis_db $obj->titel = $row->titel; $obj->titel_english = $row->titel_english; $obj->lehreinheit_id = $row->lehreinheit_id; + $obj->lehrveranstaltung_id = $row->lehrveranstaltung_id; + $obj->studiensemester_kurzbz = $row->studiensemester_kurzbz; $obj->student_uid = $row->student_uid; $obj->firma_id = $row->firma_id; $obj->note = $row->note; @@ -470,6 +481,8 @@ class projektarbeit extends basis_db $obj->titel = $row->titel; $obj->titel_english = $row->titel_english; $obj->lehreinheit_id = $row->lehreinheit_id; + $obj->lehrveranstaltung_id = $row->lehrveranstaltung_id; + $obj->studiensemester_kurzbz = $row->studiensemester_kurzbz; $obj->student_uid = $row->student_uid; $obj->firma_id = $row->firma_id; $obj->note = $row->note; @@ -534,7 +547,6 @@ class projektarbeit extends basis_db pa.projekttyp_kurzbz FROM lehre.tbl_projektarbeit pa - JOIN lehre.tbl_lehreinheit USING(lehreinheit_id) JOIN public.tbl_studiensemester sem USING(studiensemester_kurzbz) LEFT JOIN ( SELECT diff --git a/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js b/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js index 66e932d28..daf10c1fc 100644 --- a/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js +++ b/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js @@ -688,10 +688,20 @@ export const AbgabetoolAssistenz = { createButton('fa fa-folder-open', 'abgabetool/c4details', () => this.setDetailComponent(val)), createButton('fa fa-timeline', 'abgabetool/c4termineTimeLine', () => this.openTimeline(val)) ); + if(val.latestTerminWithUpload) { + actionButtons.append( + createButton('fa fa-download', 'abgabetool/c4downloadLatestAbgabe', () => this.downloadAbgabe(val.latestTerminWithUpload.paabgabe_id, val.student_uid, val.projektarbeit_id)) + ) + } return actionButtons; }, + downloadAbgabe(paabgabe_id, student_uid, projektarbeit_id) { + const url = `/api/frontend/v1/Abgabe/getStudentProjektarbeitAbgabeFile?paabgabe_id=${paabgabe_id}&student_uid=${student_uid}&projektarbeit_id=${projektarbeit_id}`; + window.open(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + url) + // this.$api.call(ApiAbgabe.getStudentProjektarbeitAbgabeFile(termin.paabgabe_id, this.projektarbeit.student_uid)) + }, undoSelection(cell) { // checks if cells row is selected and unselects -> imitates columns which dont trigger row selection // but actually just revert it after the fact @@ -780,12 +790,15 @@ export const AbgabetoolAssistenz = { projekt.note_bez = opt.bezeichnung } + const latestTerminWithUpload = this.findLatestTerminWithUpload(projekt) + return { ...projekt, abgabetermine: projekt.abgabetermine, details: { student_uid: projekt.student_uid, projektarbeit_id: projekt.projektarbeit_id, + latestTerminWithUpload: latestTerminWithUpload ?? null }, pkz: this.buildPKZ(projekt), beurteilung: projekt.beurteilungLink ?? null, @@ -799,6 +812,15 @@ export const AbgabetoolAssistenz = { } }) }, + findLatestTerminWithUpload(projekt) { + const withAbgabedatumSorted = projekt?.abgabetermine?.filter(t => t.abgabedatum != null)?.sort((a,b) => a < b) + + if(withAbgabedatumSorted.length) { + return withAbgabedatumSorted[0] + } + + return null + }, createInfoString(data) { let str = ''; @@ -1411,9 +1433,12 @@ export const AbgabetoolAssistenz = {
-
+

{{$p.t('abgabetool/abgabetoolTitle')}}

+
+ +
+
+ +
+ projekarbeit.projektarbeit_id == details.projektarbeit_id) + const projektarbeiten = this.projektarbeiten?.retval ?? this.projektarbeiten + + const pa = projektarbeiten.find(projekarbeit => projekarbeit.projektarbeit_id == details.projektarbeit_id) let paIsBenotet = false if(pa.note !== undefined && pa.note !== null) { diff --git a/public/js/components/Form/Input.js b/public/js/components/Form/Input.js index 3c3fa45d5..4ad555ab7 100644 --- a/public/js/components/Form/Input.js +++ b/public/js/components/Form/Input.js @@ -170,6 +170,7 @@ export default { return this.$attrs.modelValue; }, set(v) { + this.clearValidationForThisName() if (!this.$attrs.hasOwnProperty('modelValue')) this.modelValueDummy = v; this.$emit('update:modelValue', v); @@ -242,9 +243,9 @@ export default { template: ` - - - + + lehreinheit_id); +// $lehreinheit = new lehreinheit($row->lehreinheit_id); echo ' @@ -80,8 +80,8 @@ function draw_content($row) titel).']]> titel_english).']]> lehreinheit_id.']]> - studiensemester_kurzbz.']]> - lehrveranstaltung_id.']]> + studiensemester_kurzbz.']]> + lehrveranstaltung_id.']]> student_uid.']]> firma_id.']]> note.']]> diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 580f15bc2..28ac366e3 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -45173,6 +45173,26 @@ array( ) ) ), + array( + 'app' => 'core', + 'category' => 'abgabetool', + 'phrase' => 'c4downloadLatestAbgabe', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Zuletzt getÃĪtigte Abgabe herunterladen", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Download latest uploaded File', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'abgabetool', @@ -46634,6 +46654,26 @@ array( ) ) ), + array( + 'app' => 'core', + 'category' => 'abgabetool', + 'phrase' => 'c4termineTimeLine', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Zeitstrahl Termine', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Timeline Deadlines', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), // ABGABETOOL PHRASEN END array( 'app' => 'core',