mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-07-27 16:07:45 -07:00
🤖 Auto commit for release 'develop' on 2026-01-23
This commit is contained in:
@@ -57,7 +57,7 @@ class EditController extends Controller
|
||||
app('view')->share('mainTitleIcon', 'fa-bullseye');
|
||||
|
||||
$this->attachments = app(AttachmentHelperInterface::class);
|
||||
$this->piggyRepos = app(PiggyBankRepositoryInterface::class);
|
||||
$this->piggyRepos = app(PiggyBankRepositoryInterface::class);
|
||||
|
||||
return $next($request);
|
||||
});
|
||||
@@ -82,10 +82,10 @@ class EditController extends Controller
|
||||
$subTitleIcon = 'fa-pencil';
|
||||
$note = $piggyBank->notes()->first();
|
||||
// Flash some data to fill the form.
|
||||
$targetDate = $piggyBank->target_date?->format('Y-m-d');
|
||||
$startDate = $piggyBank->start_date?->format('Y-m-d');
|
||||
$targetDate = $piggyBank->target_date?->format('Y-m-d');
|
||||
$startDate = $piggyBank->start_date?->format('Y-m-d');
|
||||
|
||||
$preFilled = [
|
||||
$preFilled = [
|
||||
'name' => $piggyBank->name,
|
||||
'transaction_currency_id' => (int) $piggyBank->transaction_currency_id,
|
||||
'target_amount' => Steam::bcround($piggyBank->target_amount, $piggyBank->transactionCurrency->decimal_places),
|
||||
@@ -93,7 +93,7 @@ class EditController extends Controller
|
||||
'start_date' => $startDate,
|
||||
'accounts' => [],
|
||||
'object_group' => null !== $piggyBank->objectGroups->first() ? $piggyBank->objectGroups->first()->title : '',
|
||||
'notes' => null === $note ? '' : $note->text
|
||||
'notes' => null === $note ? '' : $note->text,
|
||||
];
|
||||
foreach ($piggyBank->accounts as $account) {
|
||||
$preFilled['accounts'][] = $account->id;
|
||||
@@ -113,7 +113,7 @@ class EditController extends Controller
|
||||
'subTitle' => $subTitle,
|
||||
'subTitleIcon' => $subTitleIcon,
|
||||
'piggyBank' => $piggyBank,
|
||||
'preFilled' => $preFilled
|
||||
'preFilled' => $preFilled,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ class EditController extends Controller
|
||||
|
||||
// store new attachment(s):
|
||||
/** @var null|array $files */
|
||||
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;
|
||||
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;
|
||||
if (null !== $files && !auth()->user()->hasRole('demo')) {
|
||||
$this->attachments->saveAttachmentsForModel($piggyBank, $files);
|
||||
}
|
||||
@@ -142,7 +142,7 @@ class EditController extends Controller
|
||||
if (count($this->attachments->getMessages()->get('attachments')) > 0) {
|
||||
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments'));
|
||||
}
|
||||
$redirect = redirect($this->getPreviousUrl('piggy-banks.edit.url'));
|
||||
$redirect = redirect($this->getPreviousUrl('piggy-banks.edit.url'));
|
||||
|
||||
if (1 === (int) $request->get('return_to_edit')) {
|
||||
session()->put('piggy-banks.edit.fromUpdate', true);
|
||||
|
||||
Reference in New Issue
Block a user