Merge branch 'rc1_FHC4_C4' into demo-cis40

This commit is contained in:
Harald Bamberger
2025-08-05 12:00:03 +02:00
4 changed files with 169 additions and 123 deletions
@@ -34,7 +34,7 @@ class Archiv extends FHCAPI_Controller
public function __construct()
{
parent::__construct([
'get' => ['admin:r', 'assistenz:r'],
'getArchiv' => ['admin:r', 'assistenz:r'],
'getArchivVorlagen' => ['admin:r', 'assistenz:r'],
'archive' => ['admin:w', 'assistenz:w'],
'download' => ['admin:w', 'assistenz:w'],
@@ -60,9 +60,9 @@ class Archiv extends FHCAPI_Controller
* @return void
*/
public function get()
public function getArchiv()
{
$person_id = $this->input->post('person_id');
$person_id = $this->input->get('person_id');
$this->load->library('form_validation');
+43
View File
@@ -0,0 +1,43 @@
export default {
getArchiv(person_id) {
return {
method: 'get',
url: 'api/frontend/v1/stv/archiv/getArchiv',
params: { person_id }
};
},
getArchivVorlagen() {
return {
method: 'get',
url: 'api/frontend/v1/stv/archiv/getArchivVorlagen'
};
},
archive(data) {
return {
method: 'post',
url: 'api/frontend/v1/documents/archive',
params: data
};
},
archiveSigned(data) {
return {
method: 'post',
url: 'api/frontend/v1/documents/archiveSigned',
params: data
};
},
update(data) {
return {
method: 'post',
url: 'api/frontend/v1/stv/archiv/update',
params: data
};
},
delete(akte_id, studiengang_kz) {
return {
method: 'post',
url: 'api/frontend/v1/stv/archiv/delete',
params: {akte_id, studiengang_kz}
};
}
};
@@ -2,7 +2,10 @@ import {CoreFilterCmpt} from "../../../filter/Filter.js";
import FormInput from "../../../Form/Input.js";
import AkteEdit from "./Archiv/Edit.js";
import ApiStvArchiv from '../../../../api/factory/stv/archiv.js';
export default {
name: 'Archiv',
components: {
CoreFilterCmpt,
FormInput,
@@ -62,117 +65,113 @@ export default {
'AbschlussdokumentLehrgaenge'
]
}
//studiengang_kz: false
};
},
computed: {
//~ personIds() {
//~ if (this.modelValue.person_id)
//~ return [this.modelValue.person_id];
//~ return this.modelValue.map(e => e.person_id);
//~ },
tabulatorColumns() {
const columns = [
{title: "Akte Id", field: "akte_id", visible: false},
{title: this.$p.t('stv', 'archiv_title'), field: "titel"},
{title: this.$p.t('stv', 'archiv_description'), field: "bezeichnung"},
{title: this.$p.t('stv', 'archiv_creation_date'), field: "erstelltam"},
{
title: this.$p.t('stv', 'archiv_signiert'),
field: "signiert",
formatter:"tickCross",
hozAlign:"center",
formatterParams: {
tickElement: '<i class="fa fa-check text-success"></i>',
crossElement: '<i class="fa fa-xmark text-danger"></i>'
}
},
{
title: "Selfservice",
field: "stud_selfservice",
formatter:"tickCross",
hozAlign:"center",
formatterParams: {
tickElement: '<i class="fa fa-check text-success"></i>',
crossElement: '<i class="fa fa-xmark text-danger"></i>'
},
},
{title: this.$p.t('stv', 'archiv_accepted_on_at'), field: "akzeptiertamum"},
{
title: this.$p.t('stv', 'archiv_gedruckt'),
field: "gedruckt",
visible: false,
formatter:"tickCross",
hozAlign:"center",
formatterParams: {
tickElement: '<i class="fa fa-check text-success"></i>',
crossElement: '<i class="fa fa-xmark text-danger"></i>'
}
},
{
title: 'Aktionen', field: 'actions',
formatter: (cell, formatterParams, onRendered) => {
let container = document.createElement('div');
container.className = "d-flex gap-2";
let downloadButton = document.createElement('button');
downloadButton.className = 'btn btn-outline-secondary';
downloadButton.innerHTML = '<i class="fa fa-download"></i>';
downloadButton.title = this.$p.t('ui', 'downloadDok');
downloadButton.addEventListener('click', evt => {
evt.stopPropagation();
this.actionDownload(cell.getData().akte_id);
});
container.append(downloadButton);
if (this.config.showEdit)
{
let editButton = document.createElement('button');
editButton.className = 'btn btn-outline-secondary';
editButton.innerHTML = '<i class="fa fa-edit"></i>';
editButton.title = this.$p.t('ui', 'bearbeiten');
editButton.addEventListener('click', () =>
this.$refs.edit.open(cell.getData())
);
container.append(editButton);
}
let deleteButton = document.createElement('button');
deleteButton.className = 'btn btn-outline-secondary';
deleteButton.innerHTML = '<i class="fa fa-trash"></i>';
deleteButton.title = this.$p.t('ui', 'loeschen');
deleteButton.addEventListener('click', evt => {
evt.stopPropagation();
this.$fhcAlert
.confirmDelete()
.then(result => result ? {akte_id: cell.getData().akte_id, studiengang_kz: this.modelValue.studiengang_kz} : Promise.reject({handled:true}))
.then(this.$fhcApi.factory.stv.archiv.delete)
.then(() => {
//cell.getRow().delete();
this.reload();
})
.catch(this.$fhcAlert.handleSystemError);
});
container.append(deleteButton);
return container;
},
minWidth: 150, // Ensures Action-buttons will be always fully displayed
maxWidth: 150,
frozen: true
}
];
return Object.values(columns);
},
tabulatorOptions() {
return this.$fhcApi.factory.stv.archiv.tabulatorConfig({
const options = {
ajaxURL: 'dummy',
ajaxRequestFunc: () => this.$api.call(
ApiStvArchiv.getArchiv(
this.modelValue.person_id ? [this.modelValue.person_id] : null || this.modelValue.map(e => e.person_id)
)
),
ajaxResponse: (url, params, response) => response.data,
layout:"fitDataTable",
columns: this.tabulatorColumns,
//selectable: true,
//selectableRangeMode: 'click',
index: 'akte_id',
persistenceID: 'stv-details-archiv'
}, this);
persistenceID: 'stv-details-archiv',
columns: [
{title: "Akte Id", field: "akte_id", visible: false},
{title: this.$p.t('stv', 'archiv_title'), field: "titel"},
{title: this.$p.t('stv', 'archiv_description'), field: "bezeichnung"},
{title: this.$p.t('stv', 'archiv_creation_date'), field: "erstelltam"},
{
title: this.$p.t('stv', 'archiv_signiert'),
field: "signiert",
formatter:"tickCross",
hozAlign:"center",
formatterParams: {
tickElement: '<i class="fa fa-check text-success"></i>',
crossElement: '<i class="fa fa-xmark text-danger"></i>'
}
},
{
title: "Selfservice",
field: "stud_selfservice",
formatter:"tickCross",
hozAlign:"center",
formatterParams: {
tickElement: '<i class="fa fa-check text-success"></i>',
crossElement: '<i class="fa fa-xmark text-danger"></i>'
},
},
{title: this.$p.t('stv', 'archiv_accepted_on_at'), field: "akzeptiertamum"},
{
title: this.$p.t('stv', 'archiv_gedruckt'),
field: "gedruckt",
visible: false,
formatter:"tickCross",
hozAlign:"center",
formatterParams: {
tickElement: '<i class="fa fa-check text-success"></i>',
crossElement: '<i class="fa fa-xmark text-danger"></i>'
}
},
{
title: 'Aktionen', field: 'actions',
formatter: (cell, formatterParams, onRendered) => {
let container = document.createElement('div');
container.className = "d-flex gap-2";
let downloadButton = document.createElement('button');
downloadButton.className = 'btn btn-outline-secondary';
downloadButton.innerHTML = '<i class="fa fa-download"></i>';
downloadButton.title = this.$p.t('ui', 'downloadDok');
downloadButton.addEventListener('click', evt => {
evt.stopPropagation();
this.actionDownload(cell.getData().akte_id);
});
container.append(downloadButton);
if (this.config.showEdit)
{
let editButton = document.createElement('button');
editButton.className = 'btn btn-outline-secondary';
editButton.innerHTML = '<i class="fa fa-edit"></i>';
editButton.addEventListener('click', () =>
this.$refs.edit.open(cell.getData())
);
container.append(editButton);
}
let deleteButton = document.createElement('button');
deleteButton.className = 'btn btn-outline-secondary';
deleteButton.innerHTML = '<i class="fa fa-trash"></i>';
deleteButton.addEventListener('click', evt => {
evt.stopPropagation();
this.$fhcAlert
.confirmDelete()
.then(result => result ? {akte_id: cell.getData().akte_id, studiengang_kz: this.modelValue.studiengang_kz} : Promise.reject({handled:true}))
.then((params) => {
return this.$api.call(ApiStvArchiv.delete(params.akte_id, params.studiengang_kz))
})
.then(() => {
//cell.getRow().delete();
this.reload();
})
.catch(this.$fhcAlert.handleSystemError);
});
container.append(deleteButton);
return container;
},
minWidth: 150, // Ensures Action-buttons will be always fully displayed
maxWidth: 150,
frozen: true
}
]
};
return options;
},
tabulatorEvents() {
const events = [
@@ -207,18 +206,22 @@ export default {
for (let archiveData of archiveDataArr)
{
this.loading = true;
// sign document depending on signierbar property
let archiveFunction =
this.selectedVorlage.signierbar
? this.$fhcApi.factory.stv.archiv.archiveSigned
: this.$fhcApi.factory.stv.archiv.archive;
? ApiStvArchiv.archiveSigned
: ApiStvArchiv.archive;
archiveFunction({
xml: this.getXmlByXsl(this.selectedVorlage.vorlage_kurzbz),
xsl: this.selectedVorlage.vorlage_kurzbz,
ss: this.defaultSemester,
uid: archiveData.uid,
prestudent_id: archiveData.prestudent_id
})
this.$api.call(
archiveFunction({
xml: this.getXmlByXsl(this.selectedVorlage.vorlage_kurzbz),
xsl: this.selectedVorlage.vorlage_kurzbz,
ss: this.defaultSemester,
uid: archiveData.uid,
prestudent_id: archiveData.prestudent_id
})
)
.then(result => result.data)
.then(() => {
this.reload();
@@ -249,14 +252,14 @@ export default {
}
},
created() {
this.$fhcApi
.factory.stv.archiv.getArchivVorlagen()
.then(result => {this.vorlagenArchiv = result.data; this.selectedVorlage = result.data.filter(o => o.vorlage_kurzbz == 'Zeugnis')[0];})
.catch(this.$fhcAlert.handleSystemError);
this.$api
.call(ApiStvArchiv.getArchivVorlagen())
.then(result => {this.vorlagenArchiv = result.data; this.selectedVorlage = result.data.filter(o => o.vorlage_kurzbz == 'Zeugnis')[0];})
.catch(this.$fhcAlert.handleSystemError);
},
template: `
<div class="stv-details-konto h-100 d-flex flex-column">
<div class="stv-details-archiv h-100 d-flex flex-column">
<core-filter-cmpt
ref="table"
table-only
@@ -115,4 +115,4 @@ export default {
</template>
</bs-modal>
</core-form>`
};
};