added new file upload and bug fix

This commit is contained in:
Luca Haid
2025-06-18 14:09:59 +02:00
parent a5de6daf27
commit fedfaac61d
4 changed files with 55 additions and 5 deletions

View File

@@ -65,7 +65,7 @@ class ConstructionConsentJournal extends mfBaseModel {
$model = new ConstructionConsentJournal();
$table_fields = [
"constructionconsent_id", "text",
"constructionconsent_id", "text", "file_id",
"create_by","edit_by","create","edit"
];

View File

@@ -44,8 +44,19 @@ class ConstructionConsentJournalController extends mfBaseController {
}
try {
$uploaded = mfUpload::handleFormUpload("file", false, "/ConstructionConsentJournal");
} catch (Exception $e) {
var_dump($e->getMessage());
die();
$this->layout()->setFlash("Fehler beim speichern!", "error");
$this->redirect("ConstructionConsent", "View", ["id" => $consent->id]);
}
$journal = ConstructionConsentJournal::create([
"constructionconsent_id" => $consent->id,
"file_id" => $uploaded->id,
"text" => $text
]);