Skip to content

Commit

Permalink
Updated Messages export
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-vince committed Sep 14, 2023
1 parent a9f7d48 commit 92b4441
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
17 changes: 15 additions & 2 deletions models/MessageExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,23 @@ public function exportData($columns, $sessionKey = null)
$records = Message::all();

$records->each(function($record) use ($columns) {

$record->addVisible($columns);
});

return $records->toArray();
$data = $records->toArray();


foreach($data as $key => $items) {

foreach($items as $itemKey => $itemValue) {

if( is_array($itemValue) ) {
$data[$key][$itemKey] = json_encode($itemValue);
}
}

}

return $data;
}
}
8 changes: 8 additions & 0 deletions models/message/columns_export.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,11 @@ columns:
form_description:
label: janvince.smallcontactform::lang.models.message.columns.form_description
type: text

form_data:
label: janvince.smallcontactform::lang.models.message.columns.form_data
type: text

url:
label: janvince.smallcontactform::lang.models.message.columns.url
type: text
4 changes: 3 additions & 1 deletion updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -305,4 +305,6 @@
1.63.7:
- Added check to empty form fields array
1.64.0:
- Simplified default mail views for EN and CS. Added demo CMS page for mail views testing.
- Simplified default mail views for EN and CS. Added demo CMS page for mail views testing.
1.65.0:
- Updated Messages export

0 comments on commit 92b4441

Please sign in to comment.