Tab Dokumente

- Refactor Mapping for List Accepted for correct view Akzeptiertdatum and AkzeptiertVon
- Delete Testoutputs dokument_kurzbz List NotAccpeted
- Correct ColumnName for NachreichungAm
- Change Order Columns Uploaddatum, akzeptiertVon
This commit is contained in:
ma0068
2025-07-21 16:33:26 +02:00
parent 5ed2595222
commit 9d809cf843
4 changed files with 23 additions and 16 deletions
@@ -101,22 +101,29 @@ class Dokumente extends FHCAPI_Controller
}
}
//Array for total list of accepted documents
$newDataMap = [];
foreach ($arrayAccepted as $item) {
$newDataMap[] = (array)$item;
//Mapping with document_kurzbz
$preDocMap = [];
foreach ($resultPreDoc as $pre) {
$preDocMap[$pre->dokument_kurzbz] = $pre;
}
$listExistingKurzbz = array_column($newDataMap, 'dokument_kurzbz');
$mergedArray = [];
foreach ($arrayAccepted as $doc) {
$merged = clone $doc;
foreach ($resultPreDoc as $item)
{
if (!in_array($item->dokument_kurzbz, $listExistingKurzbz))
{
$newDataMap[] = (array)$item;
if (isset($preDocMap[$doc->dokument_kurzbz])) {
$merged->docdatum = $preDocMap[$doc->dokument_kurzbz]->docdatum;
$merged->insertvonma = $preDocMap[$doc->dokument_kurzbz]->insertvonma;
$merged->bezeichnung = $preDocMap[$doc->dokument_kurzbz]->bezeichnung;
} else {
$merged->akzeptiertdatum = null;
$merged->akzeptiertvon = null;
}
$mergedArray[] = $merged;
}
$this->terminateWithSuccess($newDataMap);
$this->terminateWithSuccess($mergedArray);
}
public function deleteZuordnung($prestudent_id, $dokument_kurzbz)
@@ -102,6 +102,8 @@ class Dokumentprestudent_model extends DB_Model
$qry.=" AND (v.archivierbar = FALSE OR v.archivierbar IS NULL)";
}
$qry.=" ORDER BY d.bezeichnung ASC";
return $this->execQuery($qry, $parametersArray);
}
}
@@ -42,7 +42,6 @@ export default {
hour12: false
});
}},
{title: "Akzeptiertvon", field: "insertvonma"},
{
title: "UploadDatum", field: "hochgeladenamum",
formatter: function (cell) {
@@ -57,6 +56,7 @@ export default {
hour12: false
});
}},
{title: "Akzeptiertvon", field: "insertvonma"},
{title: "Kurzbz", field: "dokument_kurzbz", visible: false},
{title: "Prestudent ID", field: "prestudent_id", visible: false},
{title: "nachgereicht", field: "nachgereicht", visible: false,
@@ -69,7 +69,7 @@ export default {
{title: "infotext", field: "infotext"},
{title: "akte_id", field: "akte_id"},
{title: "dms_id", field: "dms_id", visible: false},
{title: "titel", field: "titel_intern"},
{title: "titel", field: "titel_intern", visible: false},
{title: "vorhanden", field: "vorhanden",
formatter:"tickCross",
hozAlign:"center",
@@ -196,7 +196,7 @@ export default {
title: this.$p.t('global', 'akte_id')
});
cm.getColumnByField('nachgereicht_am').component.updateDefinition({
title: this.$p.t('global', 'dokument')
title: this.$p.t('dokumente', 'nachreichungAm')
});
}
},
@@ -349,8 +349,6 @@ export default {
@click:new="actionUploadFile"
>
<template #actions="{selected}">
<p v-for="name in selected">
{{name.dokument_kurzbz}}</p>
<button
class="btn btn-primary"
@click="acceptDocuments(selected)"