mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 18:02:18 +00:00
- namen bei tags
- phrasen hinzugefuegt
This commit is contained in:
@@ -33,22 +33,30 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
|
||||
public function getTag()
|
||||
{
|
||||
$language = $this->_getLanguageIndex();
|
||||
$id = $this->input->get('id');
|
||||
|
||||
$this->NotizModel->addSelect(
|
||||
'tbl_notiz.titel,
|
||||
"tbl_notiz.titel,
|
||||
tbl_notiz.text,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>0 as bezeichnung,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>". $language. " as bezeichnung,
|
||||
tbl_notiz.notiz_id,
|
||||
tbl_notiz_typ.style,
|
||||
tbl_notiz.erledigt as done,
|
||||
tbl_notiz.insertamum,
|
||||
tbl_notiz.updateamum,
|
||||
tbl_notiz.insertvon,
|
||||
tbl_notiz.updatevon
|
||||
'
|
||||
(verfasserperson.vorname || ' ' || verfasserperson.nachname || ' ' || '(' || verfasserbenutzer.uid || ')') as verfasser,
|
||||
(bearbeiterperson.vorname || ' ' || bearbeiterperson.nachname || ' ' || '(' || bearbeiterbenutzer.uid || ')') as bearbeiter
|
||||
"
|
||||
);
|
||||
$this->NotizModel->addJoin('public.tbl_notiz_typ', 'public.tbl_notiz.typ = public.tbl_notiz_typ.typ_kurzbz');
|
||||
|
||||
$this->NotizModel->addJoin('public.tbl_benutzer verfasserbenutzer', 'tbl_notiz.verfasser_uid = verfasserbenutzer.uid', 'LEFT');
|
||||
$this->NotizModel->addJoin('public.tbl_person verfasserperson', 'verfasserbenutzer.person_id = verfasserperson.person_id', 'LEFT');
|
||||
|
||||
$this->NotizModel->addJoin('public.tbl_benutzer bearbeiterbenutzer', 'tbl_notiz.verfasser_uid = bearbeiterbenutzer.uid', 'LEFT');
|
||||
$this->NotizModel->addJoin('public.tbl_person bearbeiterperson', 'bearbeiterbenutzer.person_id = bearbeiterperson.person_id', 'LEFT');
|
||||
|
||||
$notiz = $this->NotizModel->loadWhere(array('notiz_id' => $id));
|
||||
|
||||
$this->terminateWithSuccess(hasData($notiz) ? getData($notiz)[0] : array());
|
||||
@@ -134,7 +142,11 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
{
|
||||
$postData = $this->getPostJson();
|
||||
$updateData = $this->NotizModel->update(array('notiz_id' => $postData->id),
|
||||
array('text' => $postData->notiz)
|
||||
array('text' => $postData->notiz,
|
||||
'updateamum' => date('Y-m-d H:i:s'),
|
||||
'updatevon' => $this->_uid,
|
||||
'bearbeiter_uid' => $this->_uid,
|
||||
)
|
||||
);
|
||||
$this->terminateWithSuccess($updateData);
|
||||
}
|
||||
@@ -142,7 +154,11 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
{
|
||||
$postData = $this->getPostJson();
|
||||
$updateData = $this->NotizModel->update(array('notiz_id' => $postData->id),
|
||||
array('erledigt' => !$postData->done)
|
||||
array('erledigt' => !$postData->done,
|
||||
'updateamum' => date('Y-m-d H:i:s'),
|
||||
'updatevon' => $this->_uid,
|
||||
'bearbeiter_uid' => $this->_uid,
|
||||
)
|
||||
);
|
||||
|
||||
$this->terminateWithSuccess($updateData);
|
||||
@@ -183,5 +199,14 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
show_error('User authentification failed');
|
||||
}
|
||||
|
||||
private function _getLanguageIndex()
|
||||
{
|
||||
$this->load->model('system/Sprache_model', 'SpracheModel');
|
||||
$this->SpracheModel->addSelect('index');
|
||||
$result = $this->SpracheModel->loadWhere(array('sprache' => getUserLanguage()));
|
||||
|
||||
return hasData($result) ? getData($result)[0]->index : 1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -82,10 +82,10 @@ export default {
|
||||
this.tagData.style = item.style;
|
||||
this.tagData.zuordnung_typ = this.zuordnung_typ;
|
||||
this.tagData.done = item.done;
|
||||
this.tagData.insertamum = item.insertamum;
|
||||
this.tagData.updateamum = item.updateamum;
|
||||
this.tagData.updatevon = item.updatevon;
|
||||
this.tagData.insertvon = item.insertvon;
|
||||
this.tagData.insertamum = this.formatDateTime(item.insertamum)
|
||||
this.tagData.updateamum = this.formatDateTime(item.updateamum)
|
||||
this.tagData.bearbeiter = item.bearbeiter;
|
||||
this.tagData.verfasser = item.verfasser;
|
||||
|
||||
if (item && item.notiz_id)
|
||||
{
|
||||
@@ -146,8 +146,6 @@ export default {
|
||||
this.$refs.tagModal.hide();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
async doneTag()
|
||||
{
|
||||
@@ -181,18 +179,29 @@ export default {
|
||||
id: "",
|
||||
done: false,
|
||||
insertamum: "",
|
||||
insertvon: "",
|
||||
verfasser: "",
|
||||
updateamum: "",
|
||||
updatevon: "",
|
||||
bearbeiter: "",
|
||||
response: ""
|
||||
};
|
||||
this.selectedTagId = null;
|
||||
this.mode = "create";
|
||||
},
|
||||
formatDateTime: (dateString) => {
|
||||
if (!dateString) return null;
|
||||
return new Date(dateString).toLocaleString('de-AT', {
|
||||
year: "numeric",
|
||||
month: "2-digit",
|
||||
day: "2-digit",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
second: "2-digit"
|
||||
});
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<div class="plus_button_container" @mouseleave="hideList">
|
||||
<span :title="values.length === 0 ? 'Bitte Zeilen markieren' : ''">
|
||||
<span :title="values.length === 0 ? 'Bitte Zeilen markieren' : ''">
|
||||
<button @mouseover="showList = true"
|
||||
:disabled="!values || values.length === 0"
|
||||
class="btn btn-sm">
|
||||
@@ -223,7 +232,15 @@ export default {
|
||||
field="notiz"
|
||||
placeholder="Notiz..."
|
||||
></form-input>
|
||||
<div class="modificationdate">angelegt von {{ tagData.insertvon }} am {{ tagData.insertamum }}</div>
|
||||
<div class="modificationdate">
|
||||
<span v-if="tagData.verfasser">
|
||||
{{ $p.t('notiz', 'tag_verfasser', { 0: tagData.verfasser, 1: tagData.insertamum }) }}
|
||||
</span>
|
||||
<br />
|
||||
<span v-if="tagData.bearbeiter && tagData.insertamum !== tagData.updateamum">
|
||||
{{ $p.t('notiz', 'tag_bearbeiter', { 0: tagData.bearbeiter, 1: tagData.updateamum }) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #footer>
|
||||
@@ -234,9 +251,9 @@ export default {
|
||||
class="btn btn-success me-2"
|
||||
@click="doneTag"
|
||||
>
|
||||
{{ tagData.done ? 'Rückgängig' : 'Erledigt' }}
|
||||
{{ tagData.done ? $p.t('notiz', 'tag_rueckgaengig') : $p.t('notiz', 'tag_erledigt') }}
|
||||
</button>
|
||||
<button v-if="mode === 'edit'" class="btn btn-danger" @click="deleteTag">Löschen</button>
|
||||
<button v-if="mode === 'edit'" class="btn btn-danger" @click="deleteTag">{{ $p.t('global', 'loeschen' )}}</button>
|
||||
</div>
|
||||
<button type="button" class="btn btn-primary" @click="saveTag">
|
||||
{{ mode === "edit" ? $p.t('global', 'speichern') : $p.t('global', 'create') }}
|
||||
|
||||
@@ -24751,6 +24751,86 @@ array(
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'notiz',
|
||||
'phrase' => 'tag_rueckgaengig',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Rückgängig',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Undo',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'notiz',
|
||||
'phrase' => 'tag_erledigt',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Erledigt',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Done',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'notiz',
|
||||
'phrase' => 'tag_verfasser',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'angelegt von {0} am {1}',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Created by {0} on {1}',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'notiz',
|
||||
'phrase' => 'tag_bearbeiter',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'bearbeitet von {0} am {1}',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Edited by {0} on {1}',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
|
||||
Reference in New Issue
Block a user