mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-26 00:54:27 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e43887678e | ||
|
|
fbc88bf768 | ||
|
|
8735242e0f | ||
|
|
7c397df829 |
@@ -323,9 +323,6 @@ 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);
|
||||
@@ -338,11 +335,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'])) {
|
||||
@@ -950,16 +947,6 @@ 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');
|
||||
@@ -2009,7 +1996,7 @@ class Abgabe extends FHCAPI_Controller
|
||||
|
||||
$data = getData($res)[0];
|
||||
if($data->note !== NULL) {
|
||||
// hardcode this error msg cause phrasen arent always being updated
|
||||
// hardcode this error msg cause phrasen arent reliable and people keep bugging why the cant edit old entries they definitely shouldnt update
|
||||
$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');
|
||||
@@ -2018,25 +2005,5 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -64,7 +64,7 @@ class AuthLib
|
||||
{
|
||||
// - The uid must be NOT an empty string
|
||||
// - The current user should NOT be already logged as the given uid
|
||||
if (!isEmptyString($uid) && $this->getAuthObj()->username != $uid)
|
||||
if (!isEmptyString($uid) && $this->getAuthObj()->{self::AO_USERNAME} != $uid)
|
||||
{
|
||||
$this->_ci->load->library('PermissionLib'); // Loads permissions library
|
||||
|
||||
@@ -75,8 +75,28 @@ class AuthLib
|
||||
$loginAS = $this->_createAuthObjByPerson(array('uid' => $uid));
|
||||
if (isSuccess($loginAS))
|
||||
{
|
||||
$authObj = getData($loginAS); // get the authenticate object
|
||||
|
||||
// Store the new authentication object in authentication session
|
||||
setSessionElement(self::SESSION_NAME, self::SESSION_AUTH_OBJ, getData($loginAS));
|
||||
setSessionElement(self::SESSION_NAME, self::SESSION_AUTH_OBJ, $authObj);
|
||||
|
||||
$authObjOrigin = getSessionElement(self::SESSION_NAME, self::SESSION_AUTH_OBJ_ORIGIN);
|
||||
|
||||
// Load the LogLib
|
||||
$this->_ci->load->library('LogLib');
|
||||
// Setup the LogLib
|
||||
$this->_ci->loglib->setConfigs(
|
||||
array(
|
||||
'dbLogType' => 'API', // required
|
||||
'dbExecuteUser' => $authObjOrigin->{self::AO_USERNAME}, // current logged user
|
||||
'requestId' => 'API'
|
||||
)
|
||||
);
|
||||
// Log into the database
|
||||
$this->_ci->loglib->logInfoDB(
|
||||
'The user "'.$authObjOrigin->{self::AO_USERNAME}.'" has changed identity with the user "'.$authObj->{self::AO_USERNAME}.
|
||||
'" and person id '.$authObj->{self::AO_PERSON_ID}
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -105,7 +125,7 @@ class AuthLib
|
||||
{
|
||||
// - The person id must be a number
|
||||
// - The current user should NOT be already logged as the given person id
|
||||
if (is_numeric($person_id) && $this->getAuthObj()->person_id != $person_id)
|
||||
if (is_numeric($person_id) && $this->getAuthObj()->{self::AO_PERSON_ID} != $person_id)
|
||||
{
|
||||
$this->_ci->load->library('PermissionLib'); // Loads permissions library
|
||||
|
||||
@@ -124,6 +144,24 @@ class AuthLib
|
||||
{
|
||||
// Store the new authentication object in authentication session
|
||||
setSessionElement(self::SESSION_NAME, self::SESSION_AUTH_OBJ, $authObj);
|
||||
|
||||
$authObjOrigin = getSessionElement(self::SESSION_NAME, self::SESSION_AUTH_OBJ_ORIGIN);
|
||||
|
||||
// Load the LogLib
|
||||
$this->_ci->load->library('LogLib');
|
||||
// Setup the LogLib
|
||||
$this->_ci->loglib->setConfigs(
|
||||
array(
|
||||
'dbLogType' => 'API', // required
|
||||
'dbExecuteUser' => $authObjOrigin->{self::AO_USERNAME}, // current logged user
|
||||
'requestId' => 'API'
|
||||
)
|
||||
);
|
||||
// Log into the database
|
||||
$this->_ci->loglib->logInfoDB(
|
||||
'The user "'.$authObjOrigin->{self::AO_USERNAME}.'" has changed identity with the user "'.$authObj->{self::AO_USERNAME}.
|
||||
'" and person id '.$authObj->{self::AO_PERSON_ID}
|
||||
);
|
||||
}
|
||||
else // if does NOT have permissions
|
||||
{
|
||||
@@ -172,6 +210,22 @@ class AuthLib
|
||||
// The LoginAs account is logged out
|
||||
// The user is again connected with its real account
|
||||
setSessionElement(self::SESSION_NAME, self::SESSION_AUTH_OBJ, $authObjOrigin);
|
||||
|
||||
// Load the LogLib
|
||||
$this->_ci->load->library('LogLib');
|
||||
// Setup the LogLib
|
||||
$this->_ci->loglib->setConfigs(
|
||||
array(
|
||||
'dbLogType' => 'API', // required
|
||||
'dbExecuteUser' => $authObjOrigin->{self::AO_USERNAME}, // current logged user
|
||||
'requestId' => 'API'
|
||||
)
|
||||
);
|
||||
// Log into the database
|
||||
$this->_ci->loglib->logInfoDB(
|
||||
'The user "'.$authObjOrigin->{self::AO_USERNAME}.'" has logout from the user "'.$authObj->{self::AO_USERNAME}.
|
||||
'" and person id '.$authObj->{self::AO_PERSON_ID}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -608,3 +662,4 @@ class AuthLib
|
||||
return $finalUserBasicDataByUID;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -306,22 +306,6 @@ 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) {
|
||||
@@ -408,7 +392,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/c4studentAbgabeNotAllowedRegularv3')), class: "custom-tooltip" }
|
||||
return { value: this.$capitalize(this.$p.t('abgabetool/c4studentAbgabeNotAllowedRegularv2')), class: "custom-tooltip" }
|
||||
}
|
||||
},
|
||||
getTooltipBeurteilungerforderlich() {
|
||||
@@ -446,8 +430,7 @@ export const AbgabeStudentDetail = {
|
||||
</button>
|
||||
</p>
|
||||
|
||||
<p>{{ getErstbetreuerLabel(projektarbeit) }}: {{ projektarbeit.betreuer }}</p>
|
||||
<p v-if="hasZweitbetreuer(projektarbeit)">{{ getZweitbetreuerLabel(projektarbeit) }}: {{ getZweitbetreuerName(projektarbeit) }}</p>
|
||||
<p>{{$capitalize( $p.t('abgabetool/c4betreuerv2') ) }}: {{projektarbeit ? $p.t('abgabetool/c4betrart' + projektarbeit.betreuerart_kurzbz) + ' ' + projektarbeit.betreuer : ''}}</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="row">
|
||||
|
||||
@@ -187,9 +187,7 @@ export const AbgabetoolStudent = {
|
||||
termin.file = []
|
||||
termin.allowedToUpload = false
|
||||
|
||||
if(termin.note) { // quality gate termin already has note
|
||||
termin.allowedToUpload = false
|
||||
} else if(termin.paabgabetyp_kurzbz == 'end') {
|
||||
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) {
|
||||
@@ -310,19 +308,6 @@ 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
|
||||
@@ -525,9 +510,9 @@ export const AbgabetoolStudent = {
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<div class="col-4 col-md-3 fw-bold">{{ getErstbetreuerLabel(projektarbeit) }}</div>
|
||||
<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-8 col-md-9">
|
||||
{{ projektarbeit.betreuer }}
|
||||
{{ projektarbeit.betreuerart_kurzbz ? projektarbeit.betreuer : '' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
@@ -536,13 +521,13 @@ export const AbgabetoolStudent = {
|
||||
<a :href="getMailLink(projektarbeit)"><i class="fa fa-envelope" style="color:#00649C"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="hasZweitbetreuer(projektarbeit)" class="row mt-2">
|
||||
<div class="col-4 col-md-3 fw-bold">{{ getZweitbetreuerLabel(projektarbeit) }}</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 class="col-8 col-md-9">
|
||||
{{ getZweitbetreuerName(projektarbeit) }}
|
||||
{{ projektarbeit.zweitbetreuer?.first }}
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="hasZweitbetreuer(projektarbeit)" class="row mt-2">
|
||||
<div v-if="projektarbeit.zweitbetreuer_person_id || projektarbeit.zweitbetreuer" 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>
|
||||
|
||||
@@ -218,23 +218,15 @@ export const CoreFilterCmpt = {
|
||||
},
|
||||
columnsForFilter() {
|
||||
if (!this.filteredColumns || !this.datasetMetadata) return [];
|
||||
|
||||
const localizedColumnTitles = this.tabulator.getLang().columns;
|
||||
const isTabulatorLocalized = !!this.$props.tabulatorOptions.locale;
|
||||
|
||||
let filterTitles;
|
||||
if (isTabulatorLocalized) {
|
||||
const localizedColumnTitles = this.tabulator.getLang().columns;
|
||||
filterTitles = this.filteredColumns.reduce((a, c) => {
|
||||
a[c.field] = localizedColumnTitles[c.field];
|
||||
return a;
|
||||
}, {});
|
||||
} else {
|
||||
filterTitles = this.filteredColumns.reduce((a, c) => {
|
||||
a[c.field] = c.title;
|
||||
return a;
|
||||
}, {});
|
||||
}
|
||||
|
||||
const filterTitles = this.filteredColumns.reduce((a, c) => {
|
||||
a[c.field] =
|
||||
isTabulatorLocalized && localizedColumnTitles[c.field]
|
||||
? localizedColumnTitles[c.field]
|
||||
: c.title;
|
||||
return a;
|
||||
}, {});
|
||||
return this.datasetMetadata.map((el) => ({
|
||||
...el,
|
||||
...{ title: filterTitles[el.name] },
|
||||
|
||||
@@ -45762,7 +45762,7 @@ array(
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'abgabetool',
|
||||
'phrase' => 'c4studentAbgabeNotAllowedRegularv3',
|
||||
'phrase' => 'c4studentAbgabeNotAllowedRegularv2',
|
||||
'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 beziehungsweise Quality Gates gesperrt. Sollten Sie trotzdem etwas hochladen wollen, wenden Sie sich bitte an Ihre Studiengangsassistenz.",
|
||||
Uploads sind für bereits benotete Projektarbeiten 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 aswell as quality gates. If you still wish to upload something, please contact your program assistant.',
|
||||
Uploads are blocked for already graded project work. If you still wish to upload something, please contact your program assistant.',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user