Compare commits

...
4 changed files with 80 additions and 15 deletions
@@ -323,6 +323,9 @@ class Abgabe extends FHCAPI_Controller
$this->checkProjektarbeitForFinishedStatus($projektarbeit_id);
// block uploads for quality gate termine that are already graded
$this->checkPaabgabeForGradedStatus($paabgabe_id);
// load the $student_uid by $projektarbeit_id so we dont need any post params
$this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel');
$res = $this->ProjektarbeitModel->getStudentInfoForProjektarbeitId($projektarbeit_id);
@@ -335,11 +338,11 @@ class Abgabe extends FHCAPI_Controller
$data = getData($res)[0];
$student_uid = $data->uid;
$studiengang_kz = $data->studiengang_kz;
if(!$this->checkZuordnung($projektarbeit_id, getAuthUID(), $student_uid, $studiengang_kz)) {
$this->terminateWithError($this->p->t('abgabetool', 'c4noZuordnungBetreuerStudent', [getAuthUID(), $student_uid]));
}
$path = PAABGABE_PATH.$paabgabe_id.'_'.$student_uid.'.pdf';
if ((isset($_FILES) and isset($_FILES['file']) and ! $_FILES['file']['error'])) {
@@ -947,6 +950,16 @@ class Abgabe extends FHCAPI_Controller
$paabgabeArr = $this->getDataOrTerminateWithError($result, 'general');
$paabgabe = $paabgabeArr[0];
// resolve the insert/update user full names so the frontend info string ("saved at X by Y")
// renders immediately for freshly created/updated termine without needing a reload.
$this->load->model('person/Person_model', 'PersonModel');
if(!empty($paabgabe->insertvon)) {
$paabgabe->insertvon_fullname = getData($this->PersonModel->getFullName($paabgabe->insertvon));
}
if(!empty($paabgabe->updatevon)) {
$paabgabe->updatevon_fullname = getData($this->PersonModel->getFullName($paabgabe->updatevon));
}
// check if abgabe even has note
if($paabgabe->note) {
$this->load->model('education/Note_model', 'NoteModel');
@@ -1996,7 +2009,7 @@ class Abgabe extends FHCAPI_Controller
$data = getData($res)[0];
if($data->note !== NULL) {
// hardcode this error msg cause phrasen arent reliable and people keep bugging why the cant edit old entries they definitely shouldnt update
// hardcode this error msg cause phrasen arent always being updated
$message = $this->p->t('abgabetool','c4fehlerAktualitaetProjektarbeitv3');
if(strpos($message, "<<") === 0) { // phrase could not be loaded
$this->terminateWithError('Die Projektarbeit wurde bereits benotet, Sie dürfen deshalb keine weiteren Termine anlegen oder bearbeiten.', 'general');
@@ -2005,5 +2018,25 @@ class Abgabe extends FHCAPI_Controller
}
}
}
private function checkPaabgabeForGradedStatus($paabgabe_id) {
$this->load->model('education/Paabgabe_model', 'PaabgabeModel');
$res = $this->PaabgabeModel->load($paabgabe_id);
if(isError($res) || !hasData($res)) {
$this->terminateWithError($this->p->t('abgabetool', 'c4projektabgabeNichtGefunden'), 'general');
}
$paabgabe = getData($res)[0];
if($paabgabe->note !== NULL) {
// hardcode a fallback cause phrasen arent reliable
$message = $this->p->t('abgabetool', 'c4studentAbgabeNotAllowedRegularv3');
if(strpos($message, "<<") === 0) { // phrase could not be loaded
$this->terminateWithError('Uploads sind für bereits benotete Quality Gates gesperrt. Sollten Sie trotzdem etwas hochladen wollen, wenden Sie sich bitte an Ihre Studiengangsassistenz.', 'general');
} else {
$this->terminateWithError($message);
}
}
}
}
@@ -306,6 +306,22 @@ export const AbgabeStudentDetail = {
const noteOpt = this.notenOptions.find(opt => opt.note == termin.note)
return noteOpt ? noteOpt.bezeichnung : ''
},
hasZweitbetreuer(projektarbeit) {
return !!(projektarbeit.zweitbetreuer_person_id || projektarbeit.zweitbetreuer)
},
getErstbetreuerLabel(projektarbeit) {
return projektarbeit.betreuerart_kurzbz
? this.$capitalize(this.$p.t('abgabetool/c4betrart' + projektarbeit.betreuerart_kurzbz))
: this.$capitalize(this.$p.t('abgabetool/c4betreuerv2'))
},
getZweitbetreuerLabel(projektarbeit) {
return projektarbeit.zweitbetreuer_betreuerart_kurzbz
? this.$capitalize(this.$p.t('abgabetool/c4betrart' + projektarbeit.zweitbetreuer_betreuerart_kurzbz))
: this.$capitalize(this.$p.t('abgabetool/c4zweitbetreuerv2'))
},
getZweitbetreuerName(projektarbeit) {
return projektarbeit.zweitbetreuer?.first ?? ''
},
},
watch: {
projektarbeit(newVal) {
@@ -392,7 +408,7 @@ export const AbgabeStudentDetail = {
if(this.isViewMode) {
return { value: this.$capitalize(this.$p.t('abgabetool/c4studentAbgabeNotAllowedInViewMode')), class: "custom-tooltip" }
} else {
return { value: this.$capitalize(this.$p.t('abgabetool/c4studentAbgabeNotAllowedRegularv2')), class: "custom-tooltip" }
return { value: this.$capitalize(this.$p.t('abgabetool/c4studentAbgabeNotAllowedRegularv3')), class: "custom-tooltip" }
}
},
getTooltipBeurteilungerforderlich() {
@@ -430,7 +446,8 @@ export const AbgabeStudentDetail = {
</button>
</p>
<p>{{$capitalize( $p.t('abgabetool/c4betreuerv2') ) }}: {{projektarbeit ? $p.t('abgabetool/c4betrart' + projektarbeit.betreuerart_kurzbz) + ' ' + projektarbeit.betreuer : ''}}</p>
<p>{{ getErstbetreuerLabel(projektarbeit) }}: {{ projektarbeit.betreuer }}</p>
<p v-if="hasZweitbetreuer(projektarbeit)">{{ getZweitbetreuerLabel(projektarbeit) }}: {{ getZweitbetreuerName(projektarbeit) }}</p>
</div>
<div class="col-4">
<div class="row">
@@ -187,7 +187,9 @@ export const AbgabetoolStudent = {
termin.file = []
termin.allowedToUpload = false
if(termin.paabgabetyp_kurzbz == 'end') {
if(termin.note) { // quality gate termin already has note
termin.allowedToUpload = false
} else if(termin.paabgabetyp_kurzbz == 'end') {
const inTime = termin.fixtermin ? !this.isPastDate(termin.datum) : true
termin.allowedToUpload = inTime && this.checkQualityGatesOptional(pa.abgabetermine)
} else if(termin.fixtermin) {
@@ -308,6 +310,19 @@ export const AbgabetoolStudent = {
hasZweitbetreuer(projektarbeit) {
return !!(projektarbeit.zweitbetreuer_person_id || projektarbeit.zweitbetreuer)
},
getErstbetreuerLabel(projektarbeit) {
return projektarbeit.betreuerart_kurzbz
? this.$capitalize(this.$p.t('abgabetool/c4betrart' + projektarbeit.betreuerart_kurzbz))
: this.$capitalize(this.$p.t('abgabetool/c4betreuerv2'))
},
getZweitbetreuerLabel(projektarbeit) {
return projektarbeit.zweitbetreuer_betreuerart_kurzbz
? this.$capitalize(this.$p.t('abgabetool/c4betrart' + projektarbeit.zweitbetreuer_betreuerart_kurzbz))
: this.$capitalize(this.$p.t('abgabetool/c4zweitbetreuerv2'))
},
getZweitbetreuerName(projektarbeit) {
return projektarbeit.zweitbetreuer?.first ?? ''
},
getErstbetreuerEmailLabel(projektarbeit) {
// with only one betreuer keep the generic label; with multiple betreuer
// distinguish the email rows by their betreuungsart bezeichnung
@@ -510,9 +525,9 @@ export const AbgabetoolStudent = {
</div>
</div>
<div class="row mt-2">
<div class="col-4 col-md-3 fw-bold">{{ projektarbeit?.betreuerart_kurzbz ? $capitalize( $p.t('abgabetool/c4betrart' + projektarbeit.betreuerart_kurzbz) ) : $capitalize( $p.t('abgabetool/c4betreuerv2') ) }}</div>
<div class="col-4 col-md-3 fw-bold">{{ getErstbetreuerLabel(projektarbeit) }}</div>
<div class="col-8 col-md-9">
{{ projektarbeit.betreuerart_kurzbz ? projektarbeit.betreuer : '' }}
{{ projektarbeit.betreuer }}
</div>
</div>
<div class="row mt-2">
@@ -521,13 +536,13 @@ export const AbgabetoolStudent = {
<a :href="getMailLink(projektarbeit)"><i class="fa fa-envelope" style="color:#00649C"></i></a>
</div>
</div>
<div v-if="projektarbeit.zweitbetreuer_person_id || projektarbeit.zweitbetreuer" class="row mt-2">
<div class="col-4 col-md-3 fw-bold">{{ projektarbeit.zweitbetreuer_betreuerart_kurzbz ? $p.t('abgabetool/c4betrart' + projektarbeit.zweitbetreuer_betreuerart_kurzbz) : '' }}</div>
<div v-if="hasZweitbetreuer(projektarbeit)" class="row mt-2">
<div class="col-4 col-md-3 fw-bold">{{ getZweitbetreuerLabel(projektarbeit) }}</div>
<div class="col-8 col-md-9">
{{ projektarbeit.zweitbetreuer?.first }}
{{ getZweitbetreuerName(projektarbeit) }}
</div>
</div>
<div v-if="projektarbeit.zweitbetreuer_person_id || projektarbeit.zweitbetreuer" class="row mt-2">
<div v-if="hasZweitbetreuer(projektarbeit)" class="row mt-2">
<div class="col-4 col-md-3 fw-bold">{{ getZweitbetreuerEmailLabel(projektarbeit) }}</div>
<div class="col-8 col-md-9">
<a v-if="projektarbeit.zweitbetreuer_mail" :href="getZweitbetreuerMailLink(projektarbeit)"><i class="fa fa-envelope" style="color:#00649C"></i></a>
+3 -3
View File
@@ -45762,7 +45762,7 @@ array(
array(
'app' => 'core',
'category' => 'abgabetool',
'phrase' => 'c4studentAbgabeNotAllowedRegularv2',
'phrase' => 'c4studentAbgabeNotAllowedRegularv3',
'insertvon' => 'system',
'phrases' => array(
array(
@@ -45771,7 +45771,7 @@ array(
Um einen Endupload durchführen zu können, müssen Sie ein positiv benotetes Quality Gate 1 & Quality Gate 2 in der relevanten Projektarbeit absolviert haben.
Uploads sind für bereits benotete Projektarbeiten gesperrt. Sollten Sie trotzdem etwas hochladen wollen, wenden Sie sich bitte an Ihre Studiengangsassistenz.",
Uploads sind für bereits benotete Projektarbeiten beziehungsweise Quality Gates gesperrt. Sollten Sie trotzdem etwas hochladen wollen, wenden Sie sich bitte an Ihre Studiengangsassistenz.",
'description' => '',
'insertvon' => 'system'
),
@@ -45781,7 +45781,7 @@ array(
To be able to complete a final upload, you must have successfully completed Quality Gate 1 and Quality Gate 2 for the relevant project work.
Uploads are blocked for already graded project work. If you still wish to upload something, please contact your program assistant.',
Uploads are blocked for already graded project work aswell as quality gates. If you still wish to upload something, please contact your program assistant.',
'description' => '',
'insertvon' => 'system'
)