adds more phrasen to the profil and the profilUpdate views, headers of tables phrasen

This commit is contained in:
SimonGschnell
2024-04-19 14:24:32 +02:00
parent 4bb9c61168
commit 1447a930d3
6 changed files with 576 additions and 45 deletions
+12 -12
View File
@@ -46,7 +46,7 @@ class Profil extends Auth_Controller
// -----------------------------------------------------------------------------------------------------------------
// Public methods
/**
* index loads the Profil view
@@ -142,12 +142,12 @@ class Profil extends Auth_Controller
public function getView($uid)
{
$res = new stdClass();
// if parsing the URL did not found a UID then the UID of the logged in user is used
if($uid =="Profil" || $uid == $this->uid){
if ($uid == "Profil" || $uid == $this->uid) {
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter($this->uid);
if (isError($isMitarbeiter)) {
show_error("error while checking if UID: ".$this->uid." is a mitarbeiter");
show_error("error while checking if UID: " . $this->uid . " is a mitarbeiter");
}
$isMitarbeiter = getData($isMitarbeiter);
if ($isMitarbeiter) {
@@ -161,19 +161,19 @@ class Profil extends Auth_Controller
}
}
// UID is availabe when accessing Profil/View/:uid
else{
else {
$this->PersonModel->addSelect(["person_id"]);
$pid = $this->PersonModel->getByUid($uid);
if(isError($pid)){
show_error("error while trying to update table public.tbl_person while searching for a person with UID: ".$uid);
if (isError($pid)) {
show_error("error while trying to update table public.tbl_person while searching for a person with UID: " . $uid);
}
$pid = hasData($pid) ? getData($pid)[0] : null;
if(!$pid){
show_error("Person with UID: ".$uid." does not exist");
if (!$pid) {
show_error("Person with UID: " . $uid . " does not exist");
}
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter($uid);
if (isError($isMitarbeiter)) {
show_error("error while checking if UID: ".$uid." is a mitarbeiter");
show_error("error while checking if UID: " . $uid . " is a mitarbeiter");
}
$isMitarbeiter = getData($isMitarbeiter);
if ($isMitarbeiter) {
@@ -262,7 +262,7 @@ class Profil extends Auth_Controller
} else {
echo json_encode(error("Nation was not 'A' (Austria)"));
}
}
}
// -----------------------------------------------------------------------------------------------------------------
@@ -630,7 +630,7 @@ class Profil extends Auth_Controller
$profilUpdates = $this->ProfilUpdateModel->getProfilUpdatesWhere(['uid' => $uid]);
if (isError($profilUpdates)) {
show_error("was not able to query the table public.tbl_profil_update:" . getData($profilUpdates));
}
}
$profilUpdates = hasData($profilUpdates) ? getData($profilUpdates) : null;
return $profilUpdates;
}
+1 -4
View File
@@ -34,9 +34,6 @@ class ProfilUpdate extends Auth_Controller
'getProfilRequestFiles' => ['student/anrechnung_beantragen:r', 'user:r'],
'getStatus' => ['student/anrechnung_beantragen:r', 'user:r'],
'getTopic' => ['student/anrechnung_beantragen:r', 'user:r'],
]);
@@ -599,7 +596,7 @@ class ProfilUpdate extends Auth_Controller
$topic = "nachname";
break;
default:
show_error($this->p->t('profilUpdate', 'profilUpdate_topic_error',[$topic]));
show_error($this->p->t('profilUpdate', 'profilUpdate_topic_error', [$topic]));
return;
}
@@ -25,6 +25,7 @@ class Profil_update_model extends DB_Model
*
* @param boolean $update: conditional whether to return insertamum or updateamum
*/
//TODO: function wird nicht verwendet
public function getTimestamp($id, $update = false)
{
$selectStatement = $update ? 'updateamum' : 'insertamum';
@@ -40,8 +41,9 @@ class Profil_update_model extends DB_Model
* {dms_id:123 , name:"test"}
*
* @param boolean $profil_update_id primary key of the profil update request
* @return Array
* @return array
*/
//TODO: function wird nicht verwendet
public function getFilesFromChangeRequest($profil_update_id)
{
$this->addSelect(["requested_change"]);
@@ -62,25 +64,27 @@ class Profil_update_model extends DB_Model
$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");
$res = $this->loadWhere($whereClause);
if(isError($res)){
if (isError($res)) {
return $res;
}
if(hasData($res)){
if (hasData($res)) {
foreach (getData($res) as $request) {
$this->formatProfilRequest($request);
}
}
return $res;
}
/**
* getProfilUpdateWithPermission
*
* getProfilUpdate
* returns a profil update with id
* returns all profil updates if id is set to null
* queries the profil updates and checks if the user trying to query the data has permissions to get the profil updates
*
* @param string $whereClause additional where clause that will be appended to the db query
* @return array array with all the profil updates that the user is eligible to see
*/
public function getProfilUpdateWithPermission($whereClause = null)
{
@@ -88,8 +92,8 @@ class Profil_update_model extends DB_Model
$studentBerechtigung = $this->permissionlib->isBerechtigt('student/stammdaten', 's');
$mitarbeiterBerechtigung = $this->permissionlib->isBerechtigt('mitarbeiter/stammdaten', 's');
$oe_berechtigung = $this->permissionlib->getOE_isEntitledFor('student/stammdaten');
$lang = "select index from public.tbl_sprache where sprache =" . $this->escape(getUserLanguage());
$lang = "select index from public.tbl_sprache where sprache =" . $this->escape(getUserLanguage());
$res = [];
if ($studentBerechtigung) {
@@ -99,7 +103,7 @@ 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
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
@@ -125,7 +129,7 @@ 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"]);
$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');
@@ -149,6 +153,14 @@ class Profil_update_model extends DB_Model
}
/**
* formatProfilRequest
*
* formats the the properties of a profilUpdate request row result
*
* @param stdClass $request unflitered profilUpdate row result from the database
* @return void
*/
private function formatProfilRequest($request)
{
$request->requested_change = json_decode($request->requested_change);
@@ -99,7 +99,7 @@ export default {
<div class="form-underline ">
<div class="form-underline-titel">Vorname</div>
<div class="form-underline-titel">{{$p.t('profilUpdate','vorname')}}</div>
<span class="form-underline-content">{{name.vorname}} </span>
</div>
@@ -109,7 +109,7 @@ export default {
<div class="col-12">
<div class="form-underline ">
<div class="form-underline-titel">Nachname</div>
<div class="form-underline-titel">{{$p.t('profilUpdate','nachname')}}</div>
<span class="form-underline-content">{{name.nachname}} </span>
</div>
@@ -130,7 +130,7 @@ export default {
<div class="form-underline ">
<div class="form-underline-titel">{{bez}}</div>
<div class="form-underline-titel">{{$p.t('profil',bez)}}</div>
<span class="form-underline-content">{{wert?wert:'-'}} </span>
</div>
@@ -43,6 +43,8 @@ export default {
filter: "Pending",
events: [],
profil_update_id: Number(this.id),
// tabulator options
profil_updates_table_options: {
ajaxURL:
FHC_JS_DATA_STORAGE_OBJECT.app_root +
@@ -180,7 +182,7 @@ export default {
columns: [
{
title: "UID",
title: Vue.computed(() => this.$p.t("profilUpdate", "UID")),
field: "uid",
minWidth: 200,
resizable: true,
@@ -188,7 +190,7 @@ export default {
//responsive:0,
},
{
title: "Name",
title: Vue.computed(() => this.$p.t("profilUpdate", "Name")),
field: "name",
minWidth: 200,
resizable: true,
@@ -196,7 +198,7 @@ export default {
//responsive:0,
},
{
title: "Topic",
title: Vue.computed(() => this.$p.t("profilUpdate", "Topic")),
field: "topic",
resizable: true,
minWidth: 200,
@@ -204,7 +206,7 @@ export default {
//responsive:0,
},
{
title: "Insert Date",
title: Vue.computed(() => this.$p.t("profilUpdate", "insertamum")),
field: "insertamum",
resizable: true,
headerFilter: true,
@@ -212,7 +214,9 @@ export default {
//responsive:0,
},
{
title: "Status",
title: Vue.computed(() => {
return this.$p.t("profilUpdate", "Status");
}),
field: "status_translated",
hozAlign: "center",
headerFilter: true,
@@ -238,7 +242,9 @@ export default {
//responsive:0,
},
{
title: "View",
title: Vue.computed(() => {
return this.$p.t("profilUpdate", "actions");
}),
formatter: function () {
return "<i class='fa fa-eye'></i>";
},
+525 -9
View File
@@ -24157,7 +24157,7 @@ array(
)
)
),
// Profil Phrasen start
//Profil Phrasen start
array(
'app' => 'core',
'category' => 'profil',
@@ -24198,6 +24198,406 @@ array(
)
)
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'Username',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Benutzername',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Username',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'Anrede',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Anrede',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Salutation',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'Titel',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Titel',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Title',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'Postnomen',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Postnomen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Postnominal',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'Geburtsdatum',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Geburtsdatum',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Birthdate',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'Geburtsort',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Geburtsort',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Birthplace',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'Büro',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Büro',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Office',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'Kurzzeichen',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Kurzzeichen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Abbreviation',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'Telefon',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Telefon',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Telephone',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'telefon',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Telefon',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Telephone',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'intern',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Intern',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Internal',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'alias',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Alias',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Alias',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'email',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'E-Mail',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'E-Mail',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'Anmerkung',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Anmerkung',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Remark',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'notfallkontakt',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Notfallkontakt',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Emergency contact',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'Straße',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Straße',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Street',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'Strasse',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Straße',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Street',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'PLZ',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'PLZ',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'PLZ',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'Ort',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Ort',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Locality',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'Typ',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Typ',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Type',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profil',
@@ -24518,8 +24918,8 @@ array(
)
)
),
// Profil Phrasen end
// ProfilUpdate Phrasen start
//Profil Phrasen ende
//ProfilUpdate Phrasen start
array(
'app' => 'core',
'category' => 'profilUpdate',
@@ -25020,6 +25420,26 @@ array(
)
)
),
array(
'app' => 'core',
'category' => 'profilUpdate',
'phrase' => 'UID',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Benutzer',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'User',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profilUpdate',
@@ -25840,14 +26260,110 @@ array(
)
)
),
array(
'app' => 'core',
'category' => 'profilUpdate',
'phrase' => 'Name',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Name',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Name',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profilUpdate',
'phrase' => 'Topic',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Thema',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Topic',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profilUpdate',
'phrase' => 'insertamum',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Einfüge Datum',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Insert Date',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profilUpdate',
'phrase' => 'actions',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Aktionen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Actions',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profilUpdate',
'phrase' => 'Status',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Status',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Status',
'description' => '',
'insertvon' => 'system'
)
)
),
//ProfilUpdate Phrasen ende
// profilUpdate Phrasen ende
);