mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Finally fixed the tests.
This commit is contained in:
@@ -68,8 +68,7 @@ class ChartController extends BaseController
|
||||
// loop and get array data.
|
||||
|
||||
$url = count($accounts) == 1 && is_array($accounts)
|
||||
? '<a href="' . route('accounts.show', [$account->id]) . '">View more</a>'
|
||||
:
|
||||
? '<a href="' . route('accounts.show', [$account->id]) . '">View more</a>' :
|
||||
'<a href="' . route('accounts.index') . '">View more</a>';
|
||||
$data = [
|
||||
'chart_title' => count($accounts) == 1 ? $accounts[0]->name : 'All accounts',
|
||||
@@ -85,8 +84,9 @@ class ChartController extends BaseController
|
||||
return Response::json($data);
|
||||
}
|
||||
|
||||
public function homeAccountInfo(Account $account, $day, $month, $year)
|
||||
public function homeAccountInfo($name, $day, $month, $year)
|
||||
{
|
||||
$account = $this->_accounts->findByName($name);
|
||||
|
||||
$date = Carbon::createFromDate($year, $month, $day);
|
||||
$result = $this->_chart->accountDailySummary($account, $date);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
use Firefly\Helper\Preferences\PreferencesHelperInterface as PHI;
|
||||
use Firefly\Helper\Toolkit\ToolkitInterface as Toolkit;
|
||||
use Firefly\Storage\Account\AccountRepositoryInterface as ARI;
|
||||
use Firefly\Storage\Budget\BudgetRepositoryInterface as BRI;
|
||||
use Firefly\Storage\TransactionJournal\TransactionJournalRepositoryInterface as TJRI;
|
||||
@@ -14,27 +13,34 @@ class HomeController extends BaseController
|
||||
protected $_preferences;
|
||||
protected $_journal;
|
||||
protected $_budgets;
|
||||
protected $_tk;
|
||||
|
||||
/**
|
||||
* @param ARI $accounts
|
||||
* @param PHI $preferences
|
||||
* @param TJRI $journal
|
||||
* @param Toolkit $toolkit
|
||||
* @param BRI $budgets
|
||||
*/
|
||||
public function __construct(ARI $accounts, PHI $preferences, TJRI $journal, Toolkit $toolkit, BRI $budgets)
|
||||
public function __construct(ARI $accounts, PHI $preferences, TJRI $journal, BRI $budgets)
|
||||
{
|
||||
$this->_accounts = $accounts;
|
||||
$this->_preferences = $preferences;
|
||||
$this->_journal = $journal;
|
||||
$this->_tk = $toolkit;
|
||||
$this->_budgets = $budgets;
|
||||
View::share('menu', 'home');
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function flush()
|
||||
{
|
||||
Cache::flush();
|
||||
|
||||
return Redirect::route('index');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this|\Illuminate\View\View
|
||||
*/
|
||||
@@ -42,7 +48,8 @@ class HomeController extends BaseController
|
||||
{
|
||||
// count, maybe we need some introducing text to show:
|
||||
$count = $this->_accounts->count();
|
||||
list($start, $end) = $this->_tk->getDateRangeDates();
|
||||
$start = Session::get('start');
|
||||
$end = Session::get('end');
|
||||
|
||||
|
||||
// get the preference for the home accounts to show:
|
||||
@@ -73,14 +80,4 @@ class HomeController extends BaseController
|
||||
// build the home screen:
|
||||
return View::make('index')->with('count', $count)->with('transactions', $transactions);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function flush()
|
||||
{
|
||||
Cache::flush();
|
||||
|
||||
return Redirect::route('index');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user