Fix routes for #718

This commit is contained in:
James Cole 2017-07-26 16:40:00 +02:00
parent b3b5e0e155
commit b3bb8c386f
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
5 changed files with 11 additions and 11 deletions

View File

@ -217,7 +217,7 @@ class BillController extends Controller
$collector->setAllAssetAccounts()->setBills(new Collection([$bill]))->setLimit($pageSize)->setPage($page)->withBudgetInformation()
->withCategoryInformation();
$journals = $collector->getPaginatedJournals();
$journals->setPath('/bills/show/' . $bill->id);
$journals->setPath(route('bills.show', [$bill->id]));
$bill->nextExpectedMatch = $repository->nextExpectedMatch($bill, new Carbon);
$hideBill = true;

View File

@ -308,7 +308,7 @@ class BudgetController extends Controller
$collector->setAllAssetAccounts()->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL])->setLimit($pageSize)->setPage($page)
->withoutBudget()->withOpposingAccount();
$journals = $collector->getPaginatedJournals();
$journals->setPath('/budgets/list/no-budget');
$journals->setPath(route('budgets.no-budget'));
$count = $journals->getCollection()->count();
if ($count === 0 && $loop < 3) {
$start->subDay();
@ -366,7 +366,7 @@ class BudgetController extends Controller
$collector = app(JournalCollectorInterface::class);
$collector->setAllAssetAccounts()->setRange($start, $end)->setBudget($budget)->setLimit($pageSize)->setPage($page)->withCategoryInformation();
$journals = $collector->getPaginatedJournals();
$journals->setPath('/budgets/show/' . $budget->id);
$journals->setPath(route('budgets.show', [$budget->id]));
$subTitle = trans('firefly.all_journals_for_budget', ['name' => $budget->name]);
@ -404,7 +404,7 @@ class BudgetController extends Controller
$collector->setAllAssetAccounts()->setRange($budgetLimit->start_date, $budgetLimit->end_date)
->setBudget($budget)->setLimit($pageSize)->setPage($page)->withCategoryInformation();
$journals = $collector->getPaginatedJournals();
$journals->setPath('/budgets/show/' . $budget->id . '/' . $budgetLimit->id);
$journals->setPath(route('budgets.show', [$budget->id, $budgetLimit->id]));
$start = session('first', Carbon::create()->startOfYear());

View File

@ -214,7 +214,7 @@ class CategoryController extends Controller
$collector->setAllAssetAccounts()->setRange($start, $end)->setLimit($pageSize)->setPage($page)->withoutCategory()->withOpposingAccount();
$collector->removeFilter(InternalTransferFilter::class);
$journals = $collector->getPaginatedJournals();
$journals->setPath('/categories/list/no-category');
$journals->setPath(route('categories.no-category'));
$count = $journals->getCollection()->count();
if ($count === 0 && $loop < 3) {
$start->subDay();
@ -298,7 +298,7 @@ class CategoryController extends Controller
->setCategory($category)->withBudgetInformation()->withCategoryInformation();
$collector->removeFilter(InternalTransferFilter::class);
$journals = $collector->getPaginatedJournals();
$journals->setPath('categories/show/' . $category->id);
$journals->setPath(route('categories.show', [$category->id]));
$count = $journals->getCollection()->count();
if ($count === 0 && $loop < 3) {
$start->subDay();

View File

@ -246,7 +246,7 @@ class TagController extends Controller
$periods = new Collection;
$apiKey = env('GOOGLE_MAPS_API_KEY', '');
$sum = '0';
$path = 'tags/show/' . $tag->id;
$path = route('tags.show', [$tag->id]);
// prep for "all" view.
@ -255,7 +255,7 @@ class TagController extends Controller
$start = $repository->firstUseDate($tag);
$end = new Carbon;
$sum = $repository->sumOfTag($tag);
$path = 'tags/show/' . $tag->id . '/all';
$path = route('tags.show', [$tag->id,'all']);
}
// prep for "specific date" view.

View File

@ -78,7 +78,7 @@ class TransactionController extends Controller
$start = null;
$end = null;
$periods = new Collection;
$path = '/transactions/' . $what;
$path = route('transactions.index', [$what]);
// prep for "all" view.
if ($moment === 'all') {
@ -86,14 +86,14 @@ class TransactionController extends Controller
$first = $repository->first();
$start = $first->date ?? new Carbon;
$end = new Carbon;
$path = '/transactions/' . $what . '/all/';
$path = route('transactions.index', [$what, 'all']);
}
// prep for "specific date" view.
if (strlen($moment) > 0 && $moment !== 'all') {
$start = new Carbon($moment);
$end = Navigation::endOfPeriod($start, $range);
$path = '/transactions/' . $what . '/' . $moment;
$path = route('transactions.index', [$what, $moment]);
$subTitle = trans(
'firefly.title_' . $what . '_between',
['start' => $start->formatLocalized($this->monthAndDayFormat), 'end' => $end->formatLocalized($this->monthAndDayFormat)]