diff --git a/application/controllers/api/frontend/v1/stv/Config.php b/application/controllers/api/frontend/v1/stv/Config.php
index 0f12f5fa3..ac907057b 100644
--- a/application/controllers/api/frontend/v1/stv/Config.php
+++ b/application/controllers/api/frontend/v1/stv/Config.php
@@ -99,6 +99,8 @@ class Config extends FHCAPI_Controller
'usePoints' => defined('CIS_GESAMTNOTE_PUNKTE') && CIS_GESAMTNOTE_PUNKTE,
'edit' => 'both', // Possible values: both|header|inline
'delete' => 'both', // Possible values: both|header|inline
+ 'documents' => 'both', // Possible values: both|header|inline
+ 'documentslist' => $this->gradesDocumentsList()
]
];
@@ -235,4 +237,157 @@ class Config extends FHCAPI_Controller
]
] + $this->kontoColumns();
}
+ protected function gradesDocumentsList()
+ {
+ $permissioncheck = site_url("api/frontend/v1/documents/permissionAlternativeFormat/{studiengang_kz}");
+
+ $title_ger = $this->p->t("global", "deutsch");
+ $title_eng = $this->p->t("global", "englisch");
+ $title_ff = 'Zertifikat'; // TODO(chris): phrase
+ $title_lv = 'LV Zeugnis'; // TODO(chris): phrase
+
+ $link_ff = "documents/export/" .
+ "zertifikat.rdf.php/" .
+ "Zertifikat" .
+ "?stg_kz={studiengang_kz_lv}" .
+ "&uid={uid}" .
+ "&ss={studiensemester_kurzbz}" .
+ "&lvid={lehrveranstaltung_id}";
+ $link_lv_ger = "documents/export/" .
+ "lehrveranstaltungszeugnis.rdf.php/" .
+ "LVZeugnis" .
+ "?stg_kz={studiengang_kz}" .
+ "&uid={uid}" .
+ "&ss={studiensemester_kurzbz}" .
+ "&lvid={lehrveranstaltung_id}";
+ $link_lv_eng = "documents/export/" .
+ "lehrveranstaltungszeugnis.rdf.php/" .
+ "LVZeugnisEng" .
+ "?stg_kz={studiengang_kz}" .
+ "&uid={uid}" .
+ "&ss={studiensemester_kurzbz}" .
+ "&lvid={lehrveranstaltung_id}";
+
+ $archive_url = "api/frontend/v1/documents/archiveSigned";
+ $archive_response = $this->p->t("stv", "document_signed_and_archived");
+ $archive_post_ff = [
+ "xml" => "zertifikat.rdf.php",
+ "xsl" => "Zertifikat",
+ "stg_kz" => "{studiengang_kz_lv}",
+ "uid" => "{uid}",
+ "ss" => "{studiensemester_kurzbz}",
+ "lvid" => "{lehrveranstaltung_id}"
+ ];
+ $archive_post_lv_ger = [
+ "xml" => "lehrveranstaltungszeugnis.rdf.php",
+ "xsl" => "LVZeugnis",
+ "stg_kz" => "{studiengang_kz}",
+ "uid" => "{uid}",
+ "ss" => "{studiensemester_kurzbz}",
+ "lvid" => "{lehrveranstaltung_id}"
+ ];
+ $archive_post_lv_eng = [
+ "xml" => "lehrveranstaltungszeugnis.rdf.php",
+ "xsl" => "LVZeugnisEng",
+ "stg_kz" => "{studiengang_kz}",
+ "uid" => "{uid}",
+ "ss" => "{studiensemester_kurzbz}",
+ "lvid" => "{lehrveranstaltung_id}"
+ ];
+
+ $list = [
+ [
+ 'title' => '', // TODO(chris): phrase
+ 'children' => [
+ [
+ 'title' => $title_ff,
+ 'link' => site_url($link_ff)
+ ],
+ [
+ 'title' => $title_lv,
+ 'children' => [
+ [
+ 'title' => $title_ger,
+ 'link' => site_url($link_lv_ger),
+ 'children' => [
+ [
+ 'title' => 'PDF',
+ 'permissioncheck' => $permissioncheck,
+ 'link' => site_url($link_lv_ger)
+ ],
+ [
+ 'title' => 'DOC',
+ 'permissioncheck' => $permissioncheck,
+ 'link' => site_url($link_lv_ger . "&output=doc")
+ ],
+ [
+ 'title' => 'ODT',
+ 'permissioncheck' => $permissioncheck,
+ 'link' => site_url($link_lv_ger . "&output=odt")
+ ]
+ ]
+ ],
+ [
+ 'title' => $title_eng,
+ 'link' => site_url($link_lv_eng),
+ 'children' => [
+ [
+ 'title' => 'PDF',
+ 'permissioncheck' => $permissioncheck,
+ 'link' => site_url($link_lv_eng)
+ ],
+ [
+ 'title' => 'DOC',
+ 'permissioncheck' => $permissioncheck,
+ 'link' => site_url($link_lv_eng . "&output=doc")
+ ],
+ [
+ 'title' => 'ODT',
+ 'permissioncheck' => $permissioncheck,
+ 'link' => site_url($link_lv_eng . "&output=odt")
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ 'title' => '', // TODO(chris): phrase
+ 'children' => [
+ [
+ 'title' => $title_ff,
+ 'action' => [
+ 'url' => site_url($archive_url),
+ 'post' => $archive_post_ff,
+ 'response' => $archive_response
+ ]
+ ],
+ [
+ 'title' => $title_lv,
+ 'children' => [
+ [
+ 'title' => $title_ger,
+ 'action' => [
+ 'url' => site_url($archive_url),
+ 'post' => $archive_post_lv_ger,
+ 'response' => $archive_response
+ ]
+ ],
+ [
+ 'title' => $title_eng,
+ 'action' => [
+ 'url' => site_url($archive_url),
+ 'post' => $archive_post_lv_eng,
+ 'response' => $archive_response
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ];
+
+ return $list;
+ }
}
diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Noten/Zeugnis.js b/public/js/components/Stv/Studentenverwaltung/Details/Noten/Zeugnis.js
index e1d926d3d..bd912c25a 100644
--- a/public/js/components/Stv/Studentenverwaltung/Details/Noten/Zeugnis.js
+++ b/public/js/components/Stv/Studentenverwaltung/Details/Noten/Zeugnis.js
@@ -1,10 +1,12 @@
import {CoreFilterCmpt} from "../../../../filter/Filter.js";
import ZeugnisActions from './Zeugnis/Actions.js';
+import ZeugnisDocuments from './Zeugnis/Documents.js';
export default {
components: {
CoreFilterCmpt,
- ZeugnisActions
+ ZeugnisActions,
+ ZeugnisDocuments
},
inject: [
'config'
@@ -15,9 +17,27 @@ export default {
},
data() {
return {
- tabulatorEvents: [],
+ tabulatorEvents: [
+ {
+ event: "dataLoaded",
+ handler: data => this.data = data.map(item => {
+ item.documentslist = document.createElement("div");
+ return item;
+ })
+ },
+ {
+ event: "rowSelected",
+ handler: row => row.getElement().style.zIndex = 12
+ },
+ {
+ event: "rowDeselected",
+ handler: row => row.getElement().style.zIndex = ''
+ }
+ ],
stdsem: '',
- lastGradeList: []
+ lastGradeList: [],
+ lastClickedRow: null,
+ data: []
};
},
computed: {
@@ -125,13 +145,14 @@ export default {
{ field: 'lehrveranstaltung_bezeichnung_english', title: 'Englisch', visible: false }
];
- const hasDownload = ['both', 'inline'].includes(this.config.download);
+ const hasDocuments = ['both', 'inline'].includes(this.config.documents);
const hasDelete = ['both', 'inline'].includes(this.config.delete);
- if (hasDownload || hasDelete) {
+ if (hasDocuments || hasDelete) {
columns.push({
field: 'actions',
title: 'Actions',
+ cssClass: "overflow-visible",
headerSort: false,
formatter: cell => {
// get row data
@@ -141,13 +162,20 @@ export default {
let container = document.createElement('div');
container.className = "d-flex gap-2 justify-content-end";
+ if (hasDocuments) {
+ container.append(data.documentslist);
+ }
+
if (hasDelete) {
let deleteButton = document.createElement('button');
deleteButton.className = 'btn btn-outline-secondary';
- deleteButton.innerHTML = '';
+ const icon = document.createElement('i');
+ icon.className = 'fa fa-trash';
+ icon.title = this.$p.t('ui/loeschen');
+ deleteButton.append(icon);
deleteButton.addEventListener('click', evt => {
evt.stopPropagation();
- this.deleteGrade(data);
+ this.deleteGrade(data);// TODO(chris): test with new data object
});
container.append(deleteButton);
}
@@ -202,7 +230,7 @@ export default {
.then(result => result ? data : Promise.reject({handled:true}))
.then(this.$fhcApi.factory.stv.grades.deleteCertificate)
.then(this.$refs.table.reloadTable)
- .then(() => this.$fhcAlert.alertSuccess('deleted')) // TODO(chris): phrase
+ .then(() => this.$fhcAlert.alertSuccess(this.$p.t('ui/successDelete')))
.catch(this.$fhcAlert.handleSystemError);
}
},
@@ -223,5 +251,12 @@ export default {