mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-03 11:08:28 +00:00
Add a button to go back to the v1 layout.
This commit is contained in:
@@ -73,6 +73,7 @@ class IndexController extends Controller
|
|||||||
|
|
||||||
return response()
|
return response()
|
||||||
->json($this->jsonApiList(self::RESOURCE_KEY, $paginator, $transformer))
|
->json($this->jsonApiList(self::RESOURCE_KEY, $paginator, $transformer))
|
||||||
->header('Content-Type', self::CONTENT_TYPE);
|
->header('Content-Type', self::CONTENT_TYPE)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -69,6 +69,11 @@ abstract class Controller extends BaseController
|
|||||||
$authGuard = config('firefly.authentication_guard');
|
$authGuard = config('firefly.authentication_guard');
|
||||||
$logoutUrl = config('firefly.custom_logout_url');
|
$logoutUrl = config('firefly.custom_logout_url');
|
||||||
|
|
||||||
|
// overrule v2 layout back to v1.
|
||||||
|
if ('true' === request()->get('force_default_layout') && 'v2' === config('firefly.layout')) {
|
||||||
|
app('view')->getFinder()->setPaths([realpath(base_path('resources/views'))]);
|
||||||
|
}
|
||||||
|
|
||||||
app('view')->share('authGuard', $authGuard);
|
app('view')->share('authGuard', $authGuard);
|
||||||
app('view')->share('logoutUrl', $logoutUrl);
|
app('view')->share('logoutUrl', $logoutUrl);
|
||||||
|
|
||||||
|
@@ -34,7 +34,6 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
|||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Log;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ReconcileController
|
* Class ReconcileController
|
||||||
@@ -119,10 +118,10 @@ class ReconcileController extends Controller
|
|||||||
$clearedAmount = $this->processJournal($account, $accountCurrency, $journal, $clearedAmount);
|
$clearedAmount = $this->processJournal($account, $accountCurrency, $journal, $clearedAmount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Log::debug(sprintf('Start balance: "%s"', $startBalance));
|
\Log::debug(sprintf('Start balance: "%s"', $startBalance));
|
||||||
Log::debug(sprintf('End balance: "%s"', $endBalance));
|
\Log::debug(sprintf('End balance: "%s"', $endBalance));
|
||||||
Log::debug(sprintf('Cleared amount: "%s"', $clearedAmount));
|
\Log::debug(sprintf('Cleared amount: "%s"', $clearedAmount));
|
||||||
Log::debug(sprintf('Amount: "%s"', $amount));
|
\Log::debug(sprintf('Amount: "%s"', $amount));
|
||||||
$difference = bcadd(bcadd(bcsub($startBalance, $endBalance), $clearedAmount), $amount);
|
$difference = bcadd(bcadd(bcsub($startBalance, $endBalance), $clearedAmount), $amount);
|
||||||
$diffCompare = bccomp($difference, '0');
|
$diffCompare = bccomp($difference, '0');
|
||||||
$countCleared = count($clearedJournals);
|
$countCleared = count($clearedJournals);
|
||||||
|
@@ -75,17 +75,11 @@ class IndexController extends Controller
|
|||||||
$objectType = 'transfer';
|
$objectType = 'transfer';
|
||||||
}
|
}
|
||||||
|
|
||||||
// add a split for the (future) v2 release.
|
|
||||||
$periods = [];
|
|
||||||
$groups = [];
|
|
||||||
$subTitle = 'TODO page subtitle in v2';
|
|
||||||
|
|
||||||
$subTitleIcon = config('firefly.transactionIconsByType.'.$objectType);
|
$subTitleIcon = config('firefly.transactionIconsByType.'.$objectType);
|
||||||
$types = config('firefly.transactionTypesByType.'.$objectType);
|
$types = config('firefly.transactionTypesByType.'.$objectType);
|
||||||
$page = (int)$request->get('page');
|
$page = (int)$request->get('page');
|
||||||
$pageSize = (int)app('preferences')->get('listPageSize', 50)->data;
|
$pageSize = (int)app('preferences')->get('listPageSize', 50)->data;
|
||||||
|
|
||||||
if ('v2' !== (string)config('firefly.layout')) {
|
|
||||||
if (null === $start) {
|
if (null === $start) {
|
||||||
$start = session('start');
|
$start = session('start');
|
||||||
$end = session('end');
|
$end = session('end');
|
||||||
@@ -120,7 +114,6 @@ class IndexController extends Controller
|
|||||||
;
|
;
|
||||||
$groups = $collector->getPaginatedGroups();
|
$groups = $collector->getPaginatedGroups();
|
||||||
$groups->setPath($path);
|
$groups->setPath($path);
|
||||||
}
|
|
||||||
|
|
||||||
return view('transactions.index', compact('subTitle', 'objectType', 'subTitleIcon', 'groups', 'periods', 'start', 'end'));
|
return view('transactions.index', compact('subTitle', 'objectType', 'subTitleIcon', 'groups', 'periods', 'start', 'end'));
|
||||||
}
|
}
|
||||||
|
@@ -252,10 +252,8 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\Override]
|
||||||
* @inheritDoc
|
public function getAccountsInOrder(array $types, array $sort, int $startRow, int $endRow): Collection
|
||||||
*/
|
|
||||||
#[\Override] public function getAccountsInOrder(array $types, array $sort, int $startRow, int $endRow): Collection
|
|
||||||
{
|
{
|
||||||
$query = $this->userGroup->accounts();
|
$query = $this->userGroup->accounts();
|
||||||
if (0 !== count($types)) {
|
if (0 !== count($types)) {
|
||||||
@@ -280,12 +278,14 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
return $query->get(['accounts.*']);
|
return $query->get(['accounts.*']);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override] public function countAccounts(array $types): int
|
#[\Override]
|
||||||
|
public function countAccounts(array $types): int
|
||||||
{
|
{
|
||||||
$query = $this->userGroup->accounts();
|
$query = $this->userGroup->accounts();
|
||||||
if (0 !== count($types)) {
|
if (0 !== count($types)) {
|
||||||
$query->accountTypeIn($types);
|
$query->accountTypeIn($types);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $query->count();
|
return $query->count();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -53,15 +53,8 @@ interface AccountRepositoryInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used in the infinite accounts list.
|
* Used in the infinite accounts list.
|
||||||
*
|
|
||||||
* @param array $types
|
|
||||||
* @param array $sort
|
|
||||||
* @param int $startRow
|
|
||||||
* @param int $endRow
|
|
||||||
*
|
|
||||||
* @return Collection
|
|
||||||
*/
|
*/
|
||||||
public function getAccountsInOrder(array $types, array $sort, int $startRow, int $endRow): Collection;
|
public function getAccountsInOrder(array $types, array $sort, int $startRow, int $endRow): Collection;
|
||||||
|
|
||||||
public function getActiveAccountsByType(array $types): Collection;
|
public function getActiveAccountsByType(array $types): Collection;
|
||||||
|
|
||||||
|
@@ -1,3 +1,9 @@
|
|||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{{ route(Route::current()->getName(), Route::current()->parameters()) }}?force_default_layout=true">
|
||||||
|
<i class="fa-solid fa-landmark"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
<li class="nav-item dropdown">
|
<li class="nav-item dropdown">
|
||||||
<a class="nav-link" data-bs-toggle="dropdown" href="#">
|
<a class="nav-link" data-bs-toggle="dropdown" href="#">
|
||||||
<i class="fa-solid fa-gears"></i>
|
<i class="fa-solid fa-gears"></i>
|
||||||
|
Reference in New Issue
Block a user