mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-02-11 22:35:13 +00:00
Clean up config.
This commit is contained in:
@@ -24,12 +24,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Transaction;
|
||||
|
||||
use FireflyIII\Events\UpdatedAccount;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionGroup;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Repositories\TransactionGroup\TransactionGroupRepositoryInterface;
|
||||
use FireflyIII\Support\Facades\Preferences;
|
||||
use FireflyIII\Support\Facades\Steam;
|
||||
@@ -56,7 +52,7 @@ class DeleteController extends Controller
|
||||
|
||||
// translations:
|
||||
$this->middleware(function ($request, $next) {
|
||||
app('view')->share('title', (string) trans('firefly.transactions'));
|
||||
app('view')->share('title', (string)trans('firefly.transactions'));
|
||||
app('view')->share('mainTitleIcon', 'fa-exchange');
|
||||
|
||||
$this->repository = app(TransactionGroupRepositoryInterface::class);
|
||||
@@ -68,7 +64,7 @@ class DeleteController extends Controller
|
||||
/**
|
||||
* Shows the form that allows a user to delete a transaction journal.
|
||||
*/
|
||||
public function delete(TransactionGroup $group): Factory|Redirector|RedirectResponse|View
|
||||
public function delete(TransactionGroup $group): Factory | Redirector | RedirectResponse | View
|
||||
{
|
||||
if (!$this->isEditableGroup($group)) {
|
||||
return $this->redirectGroupToAccount($group);
|
||||
@@ -76,12 +72,12 @@ class DeleteController extends Controller
|
||||
|
||||
Log::debug(sprintf('Start of delete view for group #%d', $group->id));
|
||||
|
||||
$journal = $group->transactionJournals->first();
|
||||
$journal = $group->transactionJournals->first();
|
||||
if (null === $journal) {
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
$objectType = strtolower($journal->transaction_type_type ?? $journal->transactionType->type);
|
||||
$subTitle = (string) trans('firefly.delete_'.$objectType, ['description' => $group->title ?? $journal->description]);
|
||||
$subTitle = (string)trans('firefly.delete_' . $objectType, ['description' => $group->title ?? $journal->description]);
|
||||
$previous = Steam::getSafePreviousUrl();
|
||||
// put previous url in session
|
||||
Log::debug('Will try to remember previous URL');
|
||||
@@ -99,19 +95,19 @@ class DeleteController extends Controller
|
||||
/**
|
||||
* Actually destroys the journal.
|
||||
*/
|
||||
public function destroy(TransactionGroup $group): Redirector|RedirectResponse
|
||||
public function destroy(TransactionGroup $group): Redirector | RedirectResponse
|
||||
{
|
||||
Log::debug(sprintf('Now in %s(#%d).', __METHOD__, $group->id));
|
||||
if (!$this->isEditableGroup($group)) {
|
||||
return $this->redirectGroupToAccount($group);
|
||||
}
|
||||
|
||||
$journal = $group->transactionJournals->first();
|
||||
$journal = $group->transactionJournals->first();
|
||||
if (null === $journal) {
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
$objectType = strtolower($journal->transaction_type_type ?? $journal->transactionType->type);
|
||||
session()->flash('success', (string) trans('firefly.deleted_'.strtolower($objectType), ['description' => $group->title ?? $journal->description]));
|
||||
session()->flash('success', (string)trans('firefly.deleted_' . strtolower($objectType), ['description' => $group->title ?? $journal->description]));
|
||||
$this->repository->destroy($group);
|
||||
Preferences::mark();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user