mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-26 17:14:28 +00:00
Merge branch 'feature-30660/FHC4_StudierendenGUI_Prototyp' of github.com:FH-Complete/FHC-Core into feature-30660/FHC4_StudierendenGUI_Prototyp
This commit is contained in:
@@ -17,17 +17,27 @@ class NotizPerson extends Notiz_Controller
|
|||||||
{
|
{
|
||||||
if($typeId != "person_id")
|
if($typeId != "person_id")
|
||||||
{
|
{
|
||||||
return $this->terminateWithError($this->p->t('ui','error_typeNotizIdIncorrect'), self::ERROR_TYPE_GENERAL);
|
return $this->terminateWithError($this->p->t('ui', 'error_typeNotizIdIncorrect'), self::ERROR_TYPE_GENERAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO define permission
|
//TODO define permission
|
||||||
if(!$this->permissionlib->isBerechtigt('admin', 'suid') && !$this->permissionlib->isBerechtigt('assistenz', 'suid'))
|
if (!$this->permissionlib->isBerechtigt('admin', 'suid') && !$this->permissionlib->isBerechtigt('assistenz', 'suid'))
|
||||||
{
|
{
|
||||||
$result = $this->p->t('lehre','error_keineSchreibrechte');
|
$result = $this->p->t('lehre', 'error_keineSchreibrechte');
|
||||||
|
|
||||||
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->outputJsonSuccess(true);
|
return $this->outputJsonSuccess(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function loadDokumente()
|
||||||
|
{
|
||||||
|
$notiz_id = $this->input->post('notiz_id');
|
||||||
|
|
||||||
|
// TODO(chris): make CI variant of endpoint
|
||||||
|
$this->NotizModel->addSelect($this->NotizModel->escape(base_url('content/notizdokdownload.php?id=' . $notiz_id)) . ' AS preview');
|
||||||
|
|
||||||
|
return parent::loadDokumente();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -475,7 +475,6 @@ abstract class Notiz_Controller extends FHCAPI_Controller
|
|||||||
|
|
||||||
public function loadDokumente()
|
public function loadDokumente()
|
||||||
{
|
{
|
||||||
$_POST = json_decode(utf8_encode($this->input->raw_input_stream), true);
|
|
||||||
$notiz_id = $this->input->post('notiz_id');
|
$notiz_id = $this->input->post('notiz_id');
|
||||||
|
|
||||||
$this->NotizModel->addSelect('campus.tbl_dms_version.*');
|
$this->NotizModel->addSelect('campus.tbl_dms_version.*');
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
|
import DmsItem from './Dms/Item.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
DmsItem
|
||||||
|
},
|
||||||
emits: [
|
emits: [
|
||||||
'update:modelValue'
|
'update:modelValue'
|
||||||
],
|
],
|
||||||
@@ -81,13 +86,14 @@ export default {
|
|||||||
<div class="form-upload-dms">
|
<div class="form-upload-dms">
|
||||||
<input ref="upload" class="form-control" :class="inputClass" :id="id" :name="name" :multiple="multiple" type="file" @change="addFiles">
|
<input ref="upload" class="form-control" :class="inputClass" :id="id" :name="name" :multiple="multiple" type="file" @change="addFiles">
|
||||||
<ul v-if="modelValue.length && multiple && !noList" class="list-unstyled m-0">
|
<ul v-if="modelValue.length && multiple && !noList" class="list-unstyled m-0">
|
||||||
<li v-for="(file, index) in modelValue" :key="index" class="d-flex mx-1 mt-1 align-items-start">
|
<dms-item
|
||||||
<span class="col-auto"><i class="fa fa-file me-1"></i></span>
|
v-for="(file, index) in modelValue"
|
||||||
<span class="col">{{ file.name }}</span>
|
:key="index"
|
||||||
<button class="col-auto btn btn-outline-secondary btn-p-0" @click="removeFile(index)">
|
v-model="file"
|
||||||
<i class="fa fa-close"></i>
|
class="d-flex mx-1 mt-1 align-items-start"
|
||||||
</button>
|
@delete="removeFile(index)"
|
||||||
</li>
|
>
|
||||||
|
</dms-item>
|
||||||
</ul>
|
</ul>
|
||||||
</div>`
|
</div>`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
export default {
|
||||||
|
emits: [
|
||||||
|
'delete'
|
||||||
|
],
|
||||||
|
props: {
|
||||||
|
modelValue: {
|
||||||
|
type: [File, Object],
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
preview: ''
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
modelValue(n) {
|
||||||
|
if (n.type == 'application/x.fhc-dms+json') {
|
||||||
|
n.text().then(result => {
|
||||||
|
const obj = JSON.parse(result);
|
||||||
|
this.preview = obj.preview || '';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
template: `
|
||||||
|
<li class="form-upload-dms-item">
|
||||||
|
<span class="col-auto"><i class="fa fa-file me-1"></i></span>
|
||||||
|
<span class="col">{{ modelValue.name }}</span>
|
||||||
|
<a v-if="preview" :href="preview" target="_blank" class="col-auto btn btn-outline-secondary btn-p-0 me-1">
|
||||||
|
<i class="fa fa-download"></i>
|
||||||
|
</a>
|
||||||
|
<button class="col-auto btn btn-outline-secondary btn-p-0" @click="$emit('delete')">
|
||||||
|
<i class="fa fa-close"></i>
|
||||||
|
</button>
|
||||||
|
</li>`
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user