mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
Merge branch 'feature-67550/CIS4_Profilupdate_Finetuning'
This commit is contained in:
@@ -813,7 +813,7 @@ class ProfilUpdate extends FHCAPI_Controller
|
||||
$insert_adresse_id = $insertID;
|
||||
$insert_adresse_id = $this->getDataOrTerminateWithError($insert_adresse_id, $this->p->t('profilUpdate', 'profilUpdate_insertAdresse_error'));
|
||||
if ($insert_adresse_id) {
|
||||
$this->handleDupplicateZustellAdressen($requested_change['zustelladresse'], $insert_adresse_id);
|
||||
$this->handleDupplicateZustellAdressen($requested_change['zustelladresse'], $insert_adresse_id, $personID);
|
||||
}
|
||||
}
|
||||
//! DELETE
|
||||
@@ -825,12 +825,33 @@ class ProfilUpdate extends FHCAPI_Controller
|
||||
}
|
||||
//! UPDATE
|
||||
else {
|
||||
$requested_change['updateamum'] = "NOW()";
|
||||
$requested_change['updatevon'] = getAuthUID();
|
||||
$update_adresse_id = $this->AdresseModel->update($adresse_id, $requested_change);
|
||||
$update_adresse_id = $this->getDataOrTerminateWithError($update_adresse_id, $this->p->t('profilUpdate', 'profilUpdate_updateAdresse_error'));
|
||||
$this->handleDupplicateZustellAdressen($requested_change['zustelladresse'], $update_adresse_id);
|
||||
$curadresse_res = $this->AdresseModel->load($adresse_id);
|
||||
$curadresse = ($this->getDataOrTerminateWithError($curadresse_res))[0];
|
||||
|
||||
if($curadresse->heimatadresse)
|
||||
{
|
||||
$tmpadresse = array_merge((array) $curadresse, $requested_change);
|
||||
unset($tmpadresse["adresse_id"]);
|
||||
$tmpadresse['insertamum'] = "NOW()";
|
||||
$tmpadresse['insertvon'] = getAuthUID();
|
||||
$tmpadresse['person_id'] = $personID;
|
||||
unset($tmpadresse["heimatadresse"]);
|
||||
unset($tmpadresse["updateamum"]);
|
||||
unset($tmpadresse["updatevon"]);
|
||||
|
||||
$tmpadresse_res = $this->AdresseModel->insert($tmpadresse);
|
||||
$tmpadresse_id = $this->getDataOrTerminateWithError($tmpadresse_res, $this->p->t('profilUpdate', 'profilUpdate_insertAdresse_error'));
|
||||
$this->handleDupplicateZustellAdressen($requested_change['zustelladresse'], $tmpadresse_id, $personID);
|
||||
}
|
||||
else
|
||||
{
|
||||
$requested_change['updateamum'] = "NOW()";
|
||||
$requested_change['updatevon'] = getAuthUID();
|
||||
|
||||
$update_adresse_id = $this->AdresseModel->update($adresse_id, $requested_change);
|
||||
$update_adresse_id = $this->getDataOrTerminateWithError($update_adresse_id, $this->p->t('profilUpdate', 'profilUpdate_updateAdresse_error'));
|
||||
$this->handleDupplicateZustellAdressen($requested_change['zustelladresse'], $update_adresse_id, $personID);
|
||||
}
|
||||
}
|
||||
return $insertID ?? null;
|
||||
}
|
||||
@@ -852,7 +873,7 @@ class ProfilUpdate extends FHCAPI_Controller
|
||||
$insert_kontakt_id = $insertID;
|
||||
$insert_kontakt_id = $this->getDataOrTerminateWithError($insert_kontakt_id, $this->p->t('profilUpdate', 'profilUpdate_insertKontakt_error'));
|
||||
if ($insert_kontakt_id) {
|
||||
$this->handleDupplicateZustellKontakte($requested_change['zustellung'], $insert_kontakt_id);
|
||||
$this->handleDupplicateZustellKontakte($requested_change['zustellung'], $insert_kontakt_id, $requested_change['kontakttyp'], $personID);
|
||||
}
|
||||
}
|
||||
//! DELETE
|
||||
@@ -869,18 +890,18 @@ class ProfilUpdate extends FHCAPI_Controller
|
||||
$update_kontakt_id = $this->KontaktModel->update($kontakt_id, $requested_change);
|
||||
$update_kontakt_id = $this->getDataOrTerminateWithError($update_kontakt_id, $this->p->t('profilUpdate', 'profilUpdate_updateKontakt_error'));
|
||||
if ($update_kontakt_id) {
|
||||
$this->handleDupplicateZustellKontakte($requested_change['zustellung'], $update_kontakt_id);
|
||||
$this->handleDupplicateZustellKontakte($requested_change['zustellung'], $update_kontakt_id, $requested_change['kontakttyp'], $personID);
|
||||
}
|
||||
}
|
||||
return isset($insertID) ? $insertID : null;
|
||||
}
|
||||
|
||||
private function handleDupplicateZustellAdressen($zustellung, $adresse_id)
|
||||
private function handleDupplicateZustellAdressen($zustellung, $adresse_id, $person_id)
|
||||
{
|
||||
if ($zustellung) {
|
||||
$this->PersonModel->addSelect("public.tbl_adresse.adresse_id");
|
||||
$this->PersonModel->addJoin("public.tbl_adresse", "public.tbl_adresse.person_id = public.tbl_person.person_id");
|
||||
$zustellAdressenArray = $this->PersonModel->loadWhere(["public.tbl_person.person_id" => $this->pid, "zustelladresse" => TRUE]);
|
||||
$zustellAdressenArray = $this->PersonModel->loadWhere(["public.tbl_person.person_id" => $person_id, "zustelladresse" => TRUE]);
|
||||
if (isError($zustellAdressenArray)) {
|
||||
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_loadingZustellAdressen_error'));
|
||||
}
|
||||
@@ -893,6 +914,8 @@ class ProfilUpdate extends FHCAPI_Controller
|
||||
return $adresse->adresse_id != $adresse_id;
|
||||
});
|
||||
|
||||
$this->addMeta('bhzustelladressen', $zustellAdressenArray);
|
||||
|
||||
// remove the zustelladresse from all other zustelladressen
|
||||
foreach ($zustellAdressenArray as $adresse) {
|
||||
$this->AdresseModel->update($adresse->adresse_id, ["zustelladresse" => FALSE]);
|
||||
@@ -902,12 +925,16 @@ class ProfilUpdate extends FHCAPI_Controller
|
||||
}
|
||||
}
|
||||
|
||||
private function handleDupplicateZustellKontakte($zustellung, $kontakt_id)
|
||||
private function handleDupplicateZustellKontakte($zustellung, $kontakt_id, $kontakttyp, $person_id)
|
||||
{
|
||||
if ($zustellung) {
|
||||
$this->PersonModel->addSelect("public.tbl_kontakt.kontakt_id");
|
||||
$this->PersonModel->addJoin("public.tbl_kontakt", "public.tbl_kontakt.person_id = public.tbl_person.person_id");
|
||||
$zustellKontakteArray = $this->PersonModel->loadWhere(["public.tbl_person.person_id" => $this->pid, "zustellung" => TRUE]);
|
||||
$zustellKontakteArray = $this->PersonModel->loadWhere([
|
||||
"public.tbl_person.person_id" => $person_id,
|
||||
"zustellung" => TRUE,
|
||||
"kontakttyp" => $kontakttyp
|
||||
]);
|
||||
if (!isSuccess($zustellKontakteArray)) {
|
||||
return error($this->p->t('profilUpdate', 'profilUpdate_loadingZustellkontakte_error'));
|
||||
}
|
||||
|
||||
@@ -183,7 +183,10 @@ class ProfilLib{
|
||||
$zutrittskarte_ausgegebenam = $zutrittskarte_ausgegebenam ? current($zutrittskarte_ausgegebenam)->ausgegebenam : null;
|
||||
|
||||
//? formats date from 01-01-2000 to 01.01.2000
|
||||
$zutrittskarte_ausgegebenam = str_replace("-", ".", $zutrittskarte_ausgegebenam);
|
||||
if ($zutrittskarte_ausgegebenam !== NULL)
|
||||
{
|
||||
$zutrittskarte_ausgegebenam = (new DateTime($zutrittskarte_ausgegebenam))->format('d.m.Y');
|
||||
}
|
||||
return $zutrittskarte_ausgegebenam;
|
||||
}
|
||||
|
||||
@@ -196,7 +199,7 @@ class ProfilLib{
|
||||
private function getAdressenInfo($pid)
|
||||
{
|
||||
$this->ci->load->model("person/Adresse_model","AdresseModel");
|
||||
$adresse_res = $this->ci->AdresseModel->addSelect(["adresse_id", "strasse", "tbl_adressentyp.bezeichnung as typ", "plz", "ort", "zustelladresse", "gemeinde", "nation"]);
|
||||
$adresse_res = $this->ci->AdresseModel->addSelect(["adresse_id", "strasse", "tbl_adressentyp.bezeichnung as typ", "plz", "ort", "heimatadresse", "zustelladresse", "gemeinde", "nation"]);
|
||||
$adresse_res = $this->ci->AdresseModel->addOrder("zustelladresse", "DESC");
|
||||
$adresse_res = $this->ci->AdresseModel->addJoin("tbl_adressentyp", "typ=adressentyp_kurzbz");
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ class Profil_update_model extends DB_Model
|
||||
$this->addSelect(["public.tbl_profil_update.*", "public.tbl_person.vorname"]);
|
||||
$this->addJoin("public.tbl_benutzer", "public.tbl_benutzer.uid = public.tbl_profil_update.uid");
|
||||
$this->addJoin("public.tbl_person", "public.tbl_person.person_id = public.tbl_benutzer.person_id");
|
||||
$this->db->order_by('COALESCE(public.tbl_profil_update.updateamum, public.tbl_profil_update.insertamum)', 'DESC', false);
|
||||
$res = $this->loadWhere($whereClause);
|
||||
if (isError($res)) {
|
||||
return $res;
|
||||
@@ -118,13 +119,47 @@ class Profil_update_model extends DB_Model
|
||||
$parameters = [];
|
||||
$query = "
|
||||
SELECT
|
||||
profil_update_id, tbl_profil_update.uid, (tbl_person.vorname || ' ' || tbl_person.nachname) AS name , topic, requested_change, tbl_profil_update.updateamum, tbl_profil_update.updatevon, tbl_profil_update.insertamum, tbl_profil_update.insertvon, status, public.tbl_profil_update_status.bezeichnung_mehrsprachig[(" . $lang . ")] as status_translated, status_timestamp, status_message, attachment_id
|
||||
profil_update_id,
|
||||
tbl_profil_update.uid,
|
||||
(tbl_person.vorname || ' ' || tbl_person.nachname) AS name ,
|
||||
topic,
|
||||
requested_change,
|
||||
tbl_profil_update.updateamum,
|
||||
tbl_profil_update.updatevon,
|
||||
tbl_profil_update.insertamum,
|
||||
tbl_profil_update.insertvon,
|
||||
status,
|
||||
public.tbl_profil_update_status.bezeichnung_mehrsprachig[(" . $lang . ")] as status_translated,
|
||||
status_timestamp,
|
||||
status_message,
|
||||
attachment_id,
|
||||
UPPER(public.tbl_studiengang.typ || public.tbl_studiengang.kurzbz) AS studiengang,
|
||||
COALESCE(of.orgform_kurzbz, public.tbl_studiengang.orgform_kurzbz) AS orgform,
|
||||
NULL as oezuordnung
|
||||
FROM public.tbl_profil_update
|
||||
JOIN public.tbl_profil_update_status ON public.tbl_profil_update_status.status_kurzbz = public.tbl_profil_update.status
|
||||
JOIN public.tbl_student ON public.tbl_student.student_uid=public.tbl_profil_update.uid
|
||||
JOIN public.tbl_benutzer ON public.tbl_benutzer.uid = public.tbl_student.student_uid
|
||||
JOIN public.tbl_person ON public.tbl_benutzer.person_id=public.tbl_person.person_id
|
||||
JOIN public.tbl_studiengang ON public.tbl_studiengang.studiengang_kz=public.tbl_student.studiengang_kz
|
||||
LEFT JOIN (
|
||||
select
|
||||
pss.prestudent_id, COALESCE(sp.orgform_kurzbz, pss.orgform_kurzbz) as orgform_kurzbz
|
||||
from (
|
||||
select
|
||||
prestudent_id, max(insertamum) as insertamum
|
||||
from
|
||||
public.tbl_prestudentstatus
|
||||
where
|
||||
datum <= NOW()
|
||||
group by
|
||||
prestudent_id
|
||||
) mpss
|
||||
join
|
||||
public.tbl_prestudentstatus pss on pss.prestudent_id = mpss.prestudent_id and pss.insertamum = mpss.insertamum
|
||||
left join
|
||||
lehre.tbl_studienplan sp on pss.studienplan_id = sp.studienplan_id
|
||||
) of ON of.prestudent_id = public.tbl_student.prestudent_id
|
||||
Where public.tbl_studiengang.oe_kurzbz IN ? ";
|
||||
$parameters[] = $oe_berechtigung;
|
||||
if ($whereClause) {
|
||||
@@ -144,12 +179,33 @@ class Profil_update_model extends DB_Model
|
||||
}
|
||||
}
|
||||
if ($mitarbeiterBerechtigung) {
|
||||
$this->addSelect(["profil_update_id", "tbl_profil_update.uid", "(tbl_person.vorname || ' ' || tbl_person.nachname) AS name", "topic", "requested_change", "tbl_profil_update.updateamum", "tbl_profil_update.updatevon", "tbl_profil_update.insertamum", "tbl_profil_update.insertvon", "status", "public.tbl_profil_update_status.bezeichnung_mehrsprachig[(" . $lang . ")] AS status_translated", "status_timestamp", "status_message", "attachment_id"]);
|
||||
$this->addSelect([
|
||||
"profil_update_id",
|
||||
"tbl_profil_update.uid",
|
||||
"(tbl_person.vorname || ' ' || tbl_person.nachname) AS name",
|
||||
"topic",
|
||||
"requested_change",
|
||||
"tbl_profil_update.updateamum",
|
||||
"tbl_profil_update.updatevon",
|
||||
"tbl_profil_update.insertamum",
|
||||
"tbl_profil_update.insertvon",
|
||||
"status",
|
||||
"public.tbl_profil_update_status.bezeichnung_mehrsprachig[(" . $lang . ")] AS status_translated",
|
||||
"status_timestamp",
|
||||
"status_message",
|
||||
"attachment_id",
|
||||
"COALESCE(NULL) as studiengang",
|
||||
"COALESCE(NULL) as orgform",
|
||||
"oe.bezeichnung as oezuordnung"
|
||||
]);
|
||||
$this->addJoin('tbl_profil_update_status', 'tbl_profil_update_status.status_kurzbz=tbl_profil_update.status');
|
||||
$this->addJoin('tbl_mitarbeiter', 'tbl_mitarbeiter.mitarbeiter_uid=tbl_profil_update.uid');
|
||||
$this->addJoin('tbl_benutzer', 'tbl_benutzer.uid=tbl_profil_update.uid');
|
||||
$this->addJoin('tbl_person', 'tbl_benutzer.person_id=tbl_person.person_id');
|
||||
$this->addJoin('tbl_benutzerfunktion bf', 'bf.uid = tbl_benutzer.uid AND bf.funktion_kurzbz = \'oezuordnung\' AND NOW() >= COALESCE(bf.datum_von, \'1970-01-01\'::date) AND NOW() <= COALESCE(bf.datum_bis, \'2170-12-31\'::date)', 'LEFT');
|
||||
$this->addJoin('tbl_organisationseinheit oe', 'oe.oe_kurzbz = bf.oe_kurzbz', 'LEFT');
|
||||
$mitarbeiterRequests = $this->loadWhere($whereClause);
|
||||
|
||||
if (isError($mitarbeiterRequests))
|
||||
return error("db error: " . getData($mitarbeiterRequests));
|
||||
$mitarbeiterRequests = getData($mitarbeiterRequests) ?: [];
|
||||
|
||||
@@ -328,7 +328,7 @@ export default {
|
||||
},
|
||||
template: /*html*/ `
|
||||
<div class="container-fluid text-break fhc-form" >
|
||||
<edit-profil v-if="showModal" ref="editModal" @hideBsModal="hideEditProfilModal" :value="JSON.parse(JSON.stringify(filteredEditData))" :titel="$p.t('profil','profilBearbeiten')"></edit-profil>
|
||||
<edit-profil v-if="showModal" ref="editModal" :isMitarbeiter="true" @hideBsModal="hideEditProfilModal" :value="JSON.parse(JSON.stringify(filteredEditData))" :titel="$p.t('profil','profilBearbeiten')"></edit-profil>
|
||||
<div class="row">
|
||||
<div class="d-md-none col-12 ">
|
||||
<!--TODO: uncomment when implemented
|
||||
|
||||
@@ -120,10 +120,10 @@ export const Profil = {
|
||||
},
|
||||
sortProfilUpdates: (ele1, ele2) => {
|
||||
let result = 0;
|
||||
if (ele1.status === "pending") {
|
||||
if (ele1.status.toLowerCase() === "pending") {
|
||||
result = -1;
|
||||
} else if (ele1.status === "accepted") {
|
||||
result = ele2.status === "rejected" ? -1 : 1;
|
||||
} else if (ele1.status.toLowerCase() === "accepted") {
|
||||
result = ele2.status.toLowerCase() === "rejected" ? -1 : 1;
|
||||
} else {
|
||||
result = 1;
|
||||
}
|
||||
@@ -226,10 +226,13 @@ export const Profil = {
|
||||
kontakteArray = kontakteArray.concat(
|
||||
this.data.profilUpdates
|
||||
.filter((update) => {
|
||||
return update.requested_change.zustellung;
|
||||
return update.status === 'Pending' && update.requested_change.zustellung;
|
||||
})
|
||||
.map((kontant) => {
|
||||
return kontant.requested_change.kontakt_id;
|
||||
return {
|
||||
kontakt_id: kontant.requested_change.kontakt_id,
|
||||
kontakttyp: kontant.requested_change.kontakttyp
|
||||
};
|
||||
})
|
||||
);
|
||||
}
|
||||
@@ -241,7 +244,7 @@ export const Profil = {
|
||||
.every((kontakt) =>
|
||||
this.data.profilUpdates.some(
|
||||
(update) =>
|
||||
update.requested_change.kontakt_id == kontakt.kontakt_id
|
||||
update.status === 'Pending' && update.requested_change.kontakt_id == kontakt.kontakt_id
|
||||
)
|
||||
)
|
||||
) {
|
||||
@@ -251,7 +254,10 @@ export const Profil = {
|
||||
return kontakt.zustellung;
|
||||
})
|
||||
.map((kon) => {
|
||||
return kon.kontakt_id;
|
||||
return {
|
||||
kontakt_id: kon.kontakt_id,
|
||||
kontakttyp: kon.kontakttyp
|
||||
};
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ export default {
|
||||
view:String,
|
||||
withZustelladresse:{
|
||||
type:Boolean,
|
||||
default:false,
|
||||
default:true,
|
||||
},
|
||||
},
|
||||
data(){
|
||||
|
||||
@@ -14,6 +14,10 @@ export default {
|
||||
},
|
||||
mixins: [BsModal],
|
||||
props: {
|
||||
isMitarbeiter: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
value: Object,
|
||||
titel: String,
|
||||
zustelladressenCount: Function,
|
||||
@@ -47,6 +51,7 @@ export default {
|
||||
provide() {
|
||||
return {
|
||||
updateFileID: this.updateFileIDFunction,
|
||||
isMitarbeiter: this.isMitarbeiter
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
@@ -10,17 +10,13 @@ export default {
|
||||
|
||||
props: {
|
||||
data: Object,
|
||||
isMitarbeiter: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
files: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
},
|
||||
|
||||
inject: ["getZustelladressenCount", "updateFileID"],
|
||||
inject: ["getZustelladressenCount", "updateFileID", "isMitarbeiter"],
|
||||
|
||||
data() {
|
||||
return {
|
||||
@@ -164,10 +160,8 @@ export default {
|
||||
<div class="gy-3 row justify-content-center align-items-center">
|
||||
<!-- warning message for too many zustellungs Adressen -->
|
||||
<div v-if="showZustellAdressenWarning" class="col-12 ">
|
||||
<div class="card bg-danger mx-2">
|
||||
<div class="card-body text-white ">
|
||||
<div class="alert alert-warning mx-2">
|
||||
<span>{{$p.t('profilUpdate','zustell_adressen_warning')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End of warning -->
|
||||
@@ -177,7 +171,7 @@ export default {
|
||||
<div class="form-check mb-2">
|
||||
<input class="form-check-input" type="checkbox" @change="updateValue($event,'zustelladresse')" :checked="data.zustelladresse" id="flexCheckDefault">
|
||||
<label class="form-check-label" for="flexCheckDefault">
|
||||
{{$p.t('person','zustelladresse')}}
|
||||
{{$p.t('person','zustelladresse')}} {{$p.t('profilUpdate','infoZustelladresse')}}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -30,12 +30,15 @@ export default {
|
||||
// if the kontakt is already a zustellungskontakt when the user is editing the kontakt, then no warning is shown and the zustellung will be overwritten
|
||||
if (JSON.parse(this.originalValue).zustellung) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
const kontakteOfSelectedType = this.zustellKontakteCount.filter((element) => {
|
||||
return element.kontakttyp === this.data?.kontakttyp
|
||||
});
|
||||
// if zustellKontakteCount is not 0 and the own kontakt has the flag zustellung set to true
|
||||
if (!this.zustellKontakteCount.includes(this.data.kontakt_id)) {
|
||||
return this.data.zustellung && this.zustellKontakteCount.length;
|
||||
if (!this.zustellKontakteCount.some((element) => element.kontakt_id === this.data.kontakt_id)) {
|
||||
return this.data.zustellung && kontakteOfSelectedType.length;
|
||||
}
|
||||
return this.zustellKontakteCount.length >= 2 && this.data.zustellung;
|
||||
return this.kontakteOfSelectedType.length >= 2 && this.data.zustellung;
|
||||
},
|
||||
isChanged: function () {
|
||||
//? returns true if the original passed data object was changed
|
||||
@@ -57,16 +60,6 @@ export default {
|
||||
|
||||
<div class="gy-3 row align-items-center justify-content-center">
|
||||
|
||||
<!-- warning message for too many zustellungs Kontakte -->
|
||||
<div v-if="showZustellKontakteWarning" class="col-12 ">
|
||||
<div class="card bg-danger mx-2">
|
||||
<div class="card-body text-white ">
|
||||
<span>{{$p.t('profilUpdate','zustell_kontakte_warning')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End of warning -->
|
||||
|
||||
<div v-if="!data.kontakt_id" class="col-12">
|
||||
|
||||
|
||||
@@ -108,6 +101,14 @@ export default {
|
||||
|
||||
</div>
|
||||
|
||||
<!-- warning message for too many zustellungs Kontakte -->
|
||||
<div v-if="showZustellKontakteWarning" class="col-12 ">
|
||||
<div class="alert alert-warning mx-2">
|
||||
<span>{{$p.t('profilUpdate','zustell_kontakte_warning')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End of warning -->
|
||||
|
||||
<div class="d-flex flex-row justify-content-start col-12 allign-middle">
|
||||
<span style="opacity: 0.65; font-size: .85rem; " class="px-2">{{$p.t('profilUpdate','zustellungsKontakt')}}</span>
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import Status from "./EditProfilComponents/Status.js";
|
||||
import TextInputDokument from "./EditProfilComponents/TextInputDokument.js";
|
||||
|
||||
export default {
|
||||
name: 'EditProfilSelect',
|
||||
components: {
|
||||
Kontakt,
|
||||
EditKontakt,
|
||||
@@ -14,7 +15,7 @@ export default {
|
||||
Status,
|
||||
TextInputDokument,
|
||||
},
|
||||
inject: ["profilUpdateTopic"],
|
||||
inject: ["profilUpdateTopic", "isMitarbeiter"],
|
||||
props: {
|
||||
list: Object,
|
||||
|
||||
@@ -148,15 +149,31 @@ export default {
|
||||
<div class="list-group">
|
||||
<template v-for="item in data">
|
||||
<div class="d-flex flex-row align-items-center">
|
||||
<button style="position:relative" type="button" class=" list-group-item list-group-item-action" @click="updateOptions($event,item)" >
|
||||
<button
|
||||
style="position:relative"
|
||||
type="button" class="list-group-item list-group-item-action"
|
||||
@click="updateOptions($event,item)"
|
||||
:disabled="(this.isMitarbeiter === false && item.listview === 'Adresse' && item.data.heimatadresse === true)"
|
||||
>
|
||||
<!-- render title of options -->
|
||||
<p v-if="item.title" class="my-1" >{{item.title}}</p>
|
||||
<!-- else render list view of items -->
|
||||
<div v-else class="my-2 me-4" >
|
||||
<component :is="item.listview" v-bind="item"></component>
|
||||
<div
|
||||
v-if="(this.isMitarbeiter === false && item.listview === 'Adresse' && item.data.heimatadresse === true)"
|
||||
class="gy-2 row justify-content-center align-items-center"
|
||||
>
|
||||
<div class="col-1"> </div>
|
||||
<div class="col-11">
|
||||
<div class="alert alert-info mt-4" role="alert">
|
||||
{{ $p.t('profilUpdate','infoHeimatadresse') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
<button v-if="item.listview" @click="deleteItem(item)" type="button" class="mx-3 btn btn-danger btn-circle" :aria-label="$p.t('profilUpdate','deleteItem')" :title="$p.t('profilUpdate','deleteItem')" ><i class="fa fa-trash" aria-hide="true"></i></button>
|
||||
<button v-if="item.listview" :disabled="(this.isMitarbeiter === false && item.listview === 'Adresse' && item.data.heimatadresse === true)" @click="deleteItem(item)" type="button" class="mx-3 btn btn-danger btn-circle" :aria-label="$p.t('profilUpdate','deleteItem')" :title="$p.t('profilUpdate','deleteItem')" ><i class="fa fa-trash" aria-hide="true"></i></button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
@@ -184,13 +184,13 @@ export default {
|
||||
},
|
||||
|
||||
height: 600,
|
||||
layout: "fitColumns",
|
||||
layout: "fitDataStretchFrozen",
|
||||
|
||||
columns: [
|
||||
{
|
||||
title: this.$p.t("profilUpdate", "UID"),
|
||||
field: "uid",
|
||||
minWidth: 200,
|
||||
minWidth: 100,
|
||||
resizable: true,
|
||||
headerFilter: true,
|
||||
//responsive:0,
|
||||
@@ -203,12 +203,40 @@ export default {
|
||||
headerFilter: true,
|
||||
//responsive:0,
|
||||
},
|
||||
{
|
||||
title: this.$p.t("lehre", "studiengang") + ' (' + this.$p.t("profil", "studentIn") + ')',
|
||||
field: "studiengang",
|
||||
minWidth: 50,
|
||||
resizable: true,
|
||||
headerFilter: "list",
|
||||
headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"},
|
||||
//responsive:0,
|
||||
},
|
||||
{
|
||||
title: this.$p.t("lehre", "organisationsform") + ' (' + this.$p.t("profil", "studentIn") + ')',
|
||||
field: "orgform",
|
||||
minWidth: 50,
|
||||
resizable: true,
|
||||
headerFilter: "list",
|
||||
headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"},
|
||||
//responsive:0,
|
||||
},
|
||||
{
|
||||
title: this.$p.t("lehre", "organisationseinheit") + ' (' + this.$p.t("profil", "mitarbeiterIn") + ')',
|
||||
field: "oezuordnung",
|
||||
minWidth: 200,
|
||||
resizable: true,
|
||||
headerFilter: "list",
|
||||
headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"},
|
||||
//responsive:0,
|
||||
},
|
||||
{
|
||||
title: this.$p.t("profilUpdate", "Topic"),
|
||||
field: "topic",
|
||||
resizable: true,
|
||||
minWidth: 200,
|
||||
headerFilter: true,
|
||||
headerFilter: "list",
|
||||
headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"},
|
||||
//responsive:0,
|
||||
},
|
||||
{
|
||||
@@ -223,7 +251,8 @@ export default {
|
||||
title: this.$p.t("profilUpdate", "Status"),
|
||||
field: "status_translated",
|
||||
hozAlign: "center",
|
||||
headerFilter: true,
|
||||
headerFilter: "list",
|
||||
headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"},
|
||||
formatter: (cell, para) => {
|
||||
let iconClasses = "";
|
||||
let status = cell.getRow().getData().status;
|
||||
@@ -248,20 +277,11 @@ export default {
|
||||
{
|
||||
title: this.$p.t("profilUpdate", "actions"),
|
||||
headerSort: false,
|
||||
frozen: true,
|
||||
formatter: (cell, params) => {
|
||||
let STATUS_PENDING =
|
||||
cell.getRow().getData().status ==
|
||||
this.profilUpdateStates["Pending"];
|
||||
|
||||
let details = this.$p.t('global', 'details');
|
||||
let html = `<div class="d-flex justify-content-evenly align-items-center">
|
||||
<button class="btn border-primary border-2" id="showButton"><i class="fa-solid fa-eye fhc-primary-color"></i></button>
|
||||
${
|
||||
STATUS_PENDING ?
|
||||
`<button class="btn border-success border-2" id="acceptButton"><i class='fa fa-lg fa-circle-check text-success'></i></button>
|
||||
<button class="btn border-danger border-2" id="denyButton"><i class=' fa fa-lg fa-circle-xmark text-danger'></i></button>`
|
||||
:
|
||||
``
|
||||
}
|
||||
<button class="btn btn-secondary" id="showButton">${details}</button>
|
||||
</div>`;
|
||||
|
||||
// Convert the HTML string to an HTML node
|
||||
@@ -276,19 +296,6 @@ export default {
|
||||
this.showAcceptDenyModal(cell.getRow().getData());
|
||||
});
|
||||
|
||||
if (STATUS_PENDING) {
|
||||
node
|
||||
.querySelector("#acceptButton")
|
||||
.addEventListener("click", () => {
|
||||
this.acceptProfilUpdate(cell.getRow().getData());
|
||||
});
|
||||
node
|
||||
.querySelector("#denyButton")
|
||||
.addEventListener("click", () => {
|
||||
this.denyProfilUpdate(cell.getRow().getData());
|
||||
});
|
||||
}
|
||||
|
||||
return node;
|
||||
},
|
||||
minWidth: 200,
|
||||
@@ -382,7 +389,7 @@ export default {
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.$p.loadCategory("profilUpdate").then(() => {
|
||||
this.$p.loadCategory(["profilUpdate", "lehre", "profil", "global"]).then(() => {
|
||||
this.categoryLoaded = true;
|
||||
});
|
||||
},
|
||||
|
||||
@@ -28928,13 +28928,13 @@ array(
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Einer ihrer Adressen wird bereits zur Zustellung verwendet, möchten sie diese Adressen als Zustellungsadresse übernehmen?',
|
||||
'text' => 'Eine andere Adresse wird aktuell zur Zustellung verwendet, in Zukunft würde diese Adresse als Zustellungsadresse verwendet werden!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'One of your addresses is already used as a contact address, would you like to use this address as your new contact address?',
|
||||
'text' => 'Another address is currently used as contact address, in the future this address would be used as contact address!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
@@ -28948,13 +28948,13 @@ array(
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Einer ihrer Kontakte wird bereits zur Zustellung verwendet, möchten sie diesen Kontakt als Zustellungskontakt übernehmen?',
|
||||
'text' => 'Ein anderer Kontakt wird aktuell zur Zustellung verwendet, in Zukunft würde dieser Kontakt als Zustellungskontakt verwendet werden!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'One of your contacts is already used as a communication mean, would you like to use this contact as your new communication mean?',
|
||||
'text' => 'Another contact is currently used for communication, in the future this contact would be used for communication!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
@@ -30381,6 +30381,46 @@ array(
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'profilUpdate',
|
||||
'phrase' => 'infoHeimatadresse',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Die initiale Meldeadresse kann aufgrund von Berichtspflichten nicht verändert oder gelöscht werden.',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'The initial official address can not be changed or deleted due to reporting obligations.',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'profilUpdate',
|
||||
'phrase' => 'infoZustelladresse',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => '(Soll etwaige Post an diese Adresse geschickt werden?)',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => '(Should any paper mail be sent to this address?)',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
//ProfilUpdate Phrasen ende
|
||||
array(
|
||||
|
||||
Reference in New Issue
Block a user