mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-19 19:01:39 +00:00
Return to edit / create screen when user indicates.
This commit is contained in:
@@ -12,6 +12,7 @@ use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
||||
use Redirect;
|
||||
use Session;
|
||||
use View;
|
||||
use Input;
|
||||
|
||||
/**
|
||||
* Class RepeatedExpenseController
|
||||
@@ -144,7 +145,10 @@ class RepeatedExpenseController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings("CyclomaticComplexity") // It's exactly 5. So I don't mind.
|
||||
* @param PiggyBankFormRequest $request
|
||||
* @param PiggyBankRepositoryInterface $repository
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function store(PiggyBankFormRequest $request, PiggyBankRepositoryInterface $repository)
|
||||
{
|
||||
@@ -167,6 +171,11 @@ class RepeatedExpenseController extends Controller
|
||||
|
||||
Session::flash('success', 'Stored repeated expense "' . e($piggyBank->name) . '".');
|
||||
|
||||
if (intval(Input::get('create_another')) === 1) {
|
||||
return Redirect::route('repeated.create', $request->input('what'))->withInput();
|
||||
}
|
||||
|
||||
|
||||
return Redirect::route('repeated.index');
|
||||
}
|
||||
|
||||
@@ -195,6 +204,10 @@ class RepeatedExpenseController extends Controller
|
||||
|
||||
$piggyBank = $repository->update($repeatedExpense, $piggyBankData);
|
||||
|
||||
if (intval(Input::get('return_to_edit')) === 1) {
|
||||
return Redirect::route('repeated.edit', $piggyBank->id);
|
||||
}
|
||||
|
||||
Session::flash('success', 'Updated repeated expense "' . e($piggyBank->name) . '".');
|
||||
|
||||
return Redirect::route('repeated.index');
|
||||
|
Reference in New Issue
Block a user