Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Fix all views.
James Cole3daddd690f8d
diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.phpindex 4d6957ff89..2288539806 100644--- a/app/Providers/FireflyServiceProvider.php+++ b/app/Providers/FireflyServiceProvider.php@@ -53,9 +53,12 @@ use FireflyIII\Services\IP\IPRetrievalInterface;use FireflyIII\Services\Password\PwndVerifierV3;use FireflyIII\Services\Password\Verifier;use FireflyIII\Support\Amount;-use FireflyIII\Support\ExpandedForm;use FireflyIII\Support\FireflyConfig;+use FireflyIII\Support\ExpandedForm;use FireflyIII\Support\Form\AccountForm;+use FireflyIII\Support\Form\CurrencyForm;+use FireflyIII\Support\Form\PiggyBankForm;+use FireflyIII\Support\Form\RuleForm;use FireflyIII\Support\Navigation;use FireflyIII\Support\Preferences;use FireflyIII\Support\Steam;@@ -143,7 +146,7 @@ class FireflyServiceProvider extends ServiceProvider);$this->app->bind('expandedform',- function () {+ static function () {return new ExpandedForm;});@@ -154,6 +157,26 @@ class FireflyServiceProvider extends ServiceProviderreturn new AccountForm;});+ $this->app->bind(+ 'currencyform',+ static function () {+ return new CurrencyForm;+ }+ );++ $this->app->bind(+ 'piggybankform',+ static function () {+ return new PiggyBankForm;+ }+ );++ $this->app->bind(+ 'ruleform',+ static function () {+ return new RuleForm;+ }+ );// chart generator:$this->app->bind(GeneratorInterface::class, ChartJsGenerator::class);diff --git a/app/Support/Facades/AccountForm.php b/app/Support/Facades/AccountForm.phpindex 5e2328a42d..a9e8924286 100644--- a/app/Support/Facades/AccountForm.php+++ b/app/Support/Facades/AccountForm.php@@ -27,7 +27,7 @@ use Illuminate\Support\Facades\Facade;/*** @codeCoverageIgnore- * Class ExpandedForm.+ * Class AccountForm.**/class AccountForm extends Facadediff --git a/app/Support/Facades/CurrencyForm.php b/app/Support/Facades/CurrencyForm.phpnew file mode 100644index 0000000000..b2760568d7--- /dev/null+++ b/app/Support/Facades/CurrencyForm.php@@ -0,0 +1,44 @@+<?php+/**+ * CurrencyForm.php+ * Copyright (c) 2019 [email protected]+ *+ * This file is part of Firefly III.+ *+ * Firefly III is free software: you can redistribute it and/or modify+ * it under the terms of the GNU General Public License as published by+ * the Free Software Foundation, either version 3 of the License, or+ * (at your option) any later version.+ *+ * Firefly III is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU General Public License for more details.+ *+ * You should have received a copy of the GNU General Public License+ * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.+ */+declare(strict_types=1);++namespace FireflyIII\Support\Facades;++use Illuminate\Support\Collection;+use Illuminate\Support\Facades\Facade;++/**+ * @codeCoverageIgnore+ * Class CurrencyForm.+ *+ */+class CurrencyForm extends Facade+{+ /**+ * Get the registered name of the component.+ *+ * @return string+ */+ protected static function getFacadeAccessor(): string+ {+ return 'currencyform';+ }+}diff --git a/app/Support/Facades/ExpandedForm.php b/app/Support/Facades/ExpandedForm.phpindex 983373509d..d82ae7fd96 100644--- a/app/Support/Facades/ExpandedForm.php+++ b/app/Support/Facades/ExpandedForm.php@@ -28,9 +28,6 @@ use Illuminate\Support\Facades\Facade;/*** @codeCoverageIgnore* Class ExpandedForm.- *- * @method array makeSelectList(Collection $set)- * @method array makeSelectListWithEmpty(Collection $set)*/class ExpandedForm extends Facade{diff --git a/app/Support/Facades/PiggyBankForm.php b/app/Support/Facades/PiggyBankForm.phpnew file mode 100644index 0000000000..a454b571dc--- /dev/null+++ b/app/Support/Facades/PiggyBankForm.php@@ -0,0 +1,44 @@+<?php+/**+ * PiggyBankForm.php+ * Copyright (c) 2019 [email protected]+ *+ * This file is part of Firefly III.+ *+ * Firefly III is free software: you can redistribute it and/or modify+ * it under the terms of the GNU General Public License as published by+ * the Free Software Foundation, either version 3 of the License, or+ * (at your option) any later version.+ *+ * Firefly III is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU General Public License for more details.+ *+ * You should have received a copy of the GNU General Public License+ * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.+ */+declare(strict_types=1);++namespace FireflyIII\Support\Facades;++use Illuminate\Support\Collection;+use Illuminate\Support\Facades\Facade;++/**+ * @codeCoverageIgnore+ * Class PiggyBankForm.+ *+ */+class PiggyBankForm extends Facade+{+ /**+ * Get the registered name of the component.+ *+ * @return string+ */+ protected static function getFacadeAccessor(): string+ {+ return 'piggybankform';+ }+}diff --git a/app/Support/Facades/RuleForm.php b/app/Support/Facades/RuleForm.phpnew file mode 100644index 0000000000..1df324e057--- /dev/null+++ b/app/Support/Facades/RuleForm.php@@ -0,0 +1,44 @@+<?php+/**+ * RuleForm.php+ * Copyright (c) 2019 [email protected]+ *+ * This file is part of Firefly III.+ *+ * Firefly III is free software: you can redistribute it and/or modify+ * it under the terms of the GNU General Public License as published by+ * the Free Software Foundation, either version 3 of the License, or+ * (at your option) any later version.+ *+ * Firefly III is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU General Public License for more details.+ *+ * You should have received a copy of the GNU General Public License+ * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.+ */+declare(strict_types=1);++namespace FireflyIII\Support\Facades;++use Illuminate\Support\Collection;+use Illuminate\Support\Facades\Facade;++/**+ * @codeCoverageIgnore+ * Class RuleForm.+ *+ */+class RuleForm extends Facade+{+ /**+ * Get the registered name of the component.+ *+ * @return string+ */+ protected static function getFacadeAccessor(): string+ {+ return 'ruleform';+ }+}diff --git a/app/Support/Form/CurrencyForm.php b/app/Support/Form/CurrencyForm.phpindex 6f16f4230c..8dac83b809 100644--- a/app/Support/Form/CurrencyForm.php+++ b/app/Support/Form/CurrencyForm.php@@ -40,7 +40,9 @@ use Throwable;class CurrencyForm{use FormSupport;+/**+ * TODO cleanup and describe.* @param string $name* @param mixed $value* @param array $options@@ -64,6 +66,8 @@ class CurrencyForm}/**+ * TODO cleanup and describe.+ ** @param string $name* @param mixed $value* @param array $options@@ -90,6 +94,8 @@ class CurrencyForm/**+ * TODO describe and cleanup.+ ** @param string $name* @param mixed $value* @param array $options@@ -103,6 +109,8 @@ class CurrencyForm}/**+ * TODO cleanup and describe better.+ ** @param string $name* @param string $view* @param mixed $valuediff --git a/app/Support/Form/PiggyBankForm.php b/app/Support/Form/PiggyBankForm.phpindex 38fae973a8..40bf878201 100644--- a/app/Support/Form/PiggyBankForm.php+++ b/app/Support/Form/PiggyBankForm.php@@ -33,7 +33,10 @@ use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;class PiggyBankForm{use FormSupport;+/**+ * TODO cleanup and describe.+ ** @param string $name* @param mixed $value* @param array $optionsdiff --git a/config/app.php b/config/app.phpindex 7941e75248..7d8097079a 100644--- a/config/app.php+++ b/config/app.php@@ -100,8 +100,6 @@ return [FireflyIII\Providers\AdminServiceProvider::class,FireflyIII\Providers\RecurringServiceProvider::class,ImportServiceProvider::class,--],'aliases' => ['App' => Illuminate\Support\Facades\App::class,@@ -146,7 +144,10 @@ return ['Amount' => \FireflyIII\Support\Facades\Amount::class,'Steam' => \FireflyIII\Support\Facades\Steam::class,'ExpandedForm' => \FireflyIII\Support\Facades\ExpandedForm::class,+ 'CurrencyForm' => \FireflyIII\Support\Facades\CurrencyForm::class,'AccountForm' => \FireflyIII\Support\Facades\AccountForm::class,+ 'PiggyBankForm' => \FireflyIII\Support\Facades\PiggyBankForm::class,+ 'RuleForm' => \FireflyIII\Support\Facades\RuleForm::class,'Google2FA' => PragmaRX\Google2FALaravel\Facade::class,],diff --git a/config/twigbridge.php b/config/twigbridge.phpindex 3b62450e26..8c1137f345 100644--- a/config/twigbridge.php+++ b/config/twigbridge.php@@ -179,7 +179,7 @@ return [|*/'facades' => [- 'Breadcrumbs' => [+ 'Breadcrumbs' => ['is_safe' => ['render',],@@ -193,22 +193,37 @@ return ['Steam','Config','Request',- 'Form' => ['is_safe' => ['input', 'select', 'checkbox', 'model', 'open', 'radio', 'textarea', 'file',],],- 'ExpandedForm' => [+ 'Form' => ['is_safe' => ['input', 'select', 'checkbox', 'model', 'open', 'radio', 'textarea', 'file',],],+ 'ExpandedForm' => ['is_safe' => ['date', 'text', 'select', 'balance', 'optionsList', 'checkbox', 'amount', 'tags', 'integer', 'textarea', 'location', 'file', 'staticText',- 'password', 'nonSelectableAmount', 'number', 'amountNoCurrency', 'currencyList', 'ruleGroupList',- 'ruleGroupListWithEmpty', 'piggyBankList', 'currencyListEmpty', 'percentage', 'balanceAll',+ 'password', 'nonSelectableAmount', 'number', 'amountNoCurrency', 'percentage',],],- 'AccountForm' => [+ 'AccountForm' => ['is_safe' => ['activeAssetAccountList', 'activeLongAccountList', 'activeWithdrawalDestinations', 'activeDepositDestinations','assetAccountCheckList', 'assetAccountList', 'longAccountList',],],+ 'CurrencyForm' => [+ 'is_safe' => [+ 'currencyList', 'currencyListEmpty', 'balanceAll',+ ],+ ],+ 'PiggyBankForm' =>+ [+ 'is_safe' => [+ 'piggyBankList',+ ],+ ],+ 'RuleForm' => [+ 'is_safe' => [+ 'ruleGroupList', 'ruleGroupListWithEmpty',+ ],+ ],],diff --git a/resources/views/v1/accounts/create.twig b/resources/views/v1/accounts/create.twigindex 7c24565854..d52a1f46f2 100644--- a/resources/views/v1/accounts/create.twig+++ b/resources/views/v1/accounts/create.twig@@ -18,7 +18,7 @@<div class="box-body">{{ ExpandedForm.text('name') }}{% if objectType == 'asset' or objectType == 'liabilities' %}- {{ ExpandedForm.currencyList('currency_id', null, {helpText:'account_default_currency'|_}) }}+ {{ CurrencyForm.currencyList('currency_id', null, {helpText:'account_default_currency'|_}) }}{% endif %}{% if objectType == 'liabilities' %}{{ ExpandedForm.select('liability_type_id', liabilityTypes) }}diff --git a/resources/views/v1/accounts/edit.twig b/resources/views/v1/accounts/edit.twigindex 97f24244eb..2324f9de53 100644--- a/resources/views/v1/accounts/edit.twig+++ b/resources/views/v1/accounts/edit.twig@@ -19,7 +19,7 @@<div class="box-body">{{ ExpandedForm.text('name') }}{% if account.accountType.type == 'Default account' or account.accountType.type == 'Asset account' or objectType == 'liabilities' %}- {{ ExpandedForm.currencyList('currency_id', null, {helpText:'account_default_currency'|_}) }}+ {{ CurrencyForm.currencyList('currency_id', null, {helpText:'account_default_currency'|_}) }}{% endif %}{% if objectType == 'liabilities' %}diff --git a/resources/views/v1/bills/create.twig b/resources/views/v1/bills/create.twigindex 1ee25f1059..8d1e69ff90 100644--- a/resources/views/v1/bills/create.twig+++ b/resources/views/v1/bills/create.twig@@ -17,7 +17,7 @@</div><div class="box-body">{{ ExpandedForm.text('name') }}- {{ ExpandedForm.currencyList('transaction_currency_id', defaultCurrency.id) }}+ {{ CurrencyForm.currencyList('transaction_currency_id', defaultCurrency.id) }}{{ ExpandedForm.amountNoCurrency('amount_min') }}{{ ExpandedForm.amountNoCurrency('amount_max') }}{{ ExpandedForm.date('date',phpdate('Y-m-d')) }}diff --git a/resources/views/v1/bills/edit.twig b/resources/views/v1/bills/edit.twigindex e680c33125..509e26704c 100644--- a/resources/views/v1/bills/edit.twig+++ b/resources/views/v1/bills/edit.twig@@ -18,7 +18,7 @@</div><div class="box-body">{{ ExpandedForm.text('name') }}- {{ ExpandedForm.currencyList('transaction_currency_id') }}+ {{ CurrencyForm.currencyList('transaction_currency_id') }}{{ ExpandedForm.amountNoCurrency('amount_min') }}{{ ExpandedForm.amountNoCurrency('amount_max') }}{{ ExpandedForm.date('date',bill.date.format('Y-m-d')) }}diff --git a/resources/views/v1/new-user/index.twig b/resources/views/v1/new-user/index.twigindex a939818a4b..316bb7c5b5 100644--- a/resources/views/v1/new-user/index.twig+++ b/resources/views/v1/new-user/index.twig@@ -24,7 +24,7 @@{{ 'to_get_started'|_ }}</p>{{ ExpandedForm.text('bank_name') }}- {{ ExpandedForm.balanceAll('bank_balance') }}+ {{ CurrencyForm.balanceAll('bank_balance') }}<p class="text-success">{{ 'currency_not_present'|_ }}diff --git a/resources/views/v1/recurring/create.twig b/resources/views/v1/recurring/create.twigindex b666c8b025..9185a278ad 100644--- a/resources/views/v1/recurring/create.twig+++ b/resources/views/v1/recurring/create.twig@@ -86,7 +86,7 @@{{ ExpandedForm.text('transaction_description') }}{# transaction information (mandatory) #}- {{ ExpandedForm.currencyList('transaction_currency_id', defaultCurrency.id) }}+ {{ CurrencyForm.currencyList('transaction_currency_id', defaultCurrency.id) }}{{ ExpandedForm.amountNoCurrency('amount', []) }}{# source account if withdrawal, or if transfer: #}@@ -115,7 +115,7 @@</div><div class="box-body">{# transaction information (optional) #}- {{ ExpandedForm.currencyListEmpty('foreign_currency_id', 0) }}+ {{ CurrencyForm.currencyListEmpty('foreign_currency_id', 0) }}{{ ExpandedForm.amountNoCurrency('foreign_amount', []) }}{# BUDGET ONLY WHEN CREATING A WITHDRAWAL #}@@ -132,7 +132,7 @@{{ ExpandedForm.text('tags') }}{# RELATE THIS TRANSFER TO A PIGGY BANK #}- {{ ExpandedForm.piggyBankList('piggy_bank_id',0) }}+ {{ PiggyBankForm.piggyBankList('piggy_bank_id',0) }}</div></div></div>diff --git a/resources/views/v1/recurring/edit.twig b/resources/views/v1/recurring/edit.twigindex 05c81e9ecd..8090ba55ae 100644--- a/resources/views/v1/recurring/edit.twig+++ b/resources/views/v1/recurring/edit.twig@@ -84,7 +84,7 @@{# end of three buttons#}{{ ExpandedForm.text('transaction_description', array.transactions[0].description) }}{# transaction information (mandatory) #}- {{ ExpandedForm.currencyList('transaction_currency_id', array.transactions[0].currency_id) }}+ {{ CurrencyForm.currencyList('transaction_currency_id', array.transactions[0].currency_id) }}{{ ExpandedForm.amountNoCurrency('amount', array.transactions[0].amount) }}{# source account if withdrawal, or if transfer: #}@@ -116,7 +116,7 @@</div><div class="box-body">{# transaction information (optional) #}- {{ ExpandedForm.currencyListEmpty('foreign_currency_id', array.transactions[0].foreign_currency_id) }}+ {{ CurrencyForm.currencyListEmpty('foreign_currency_id', array.transactions[0].foreign_currency_id) }}{{ ExpandedForm.amountNoCurrency('foreign_amount', array.transactions[0].foreign_amount) }}{# BUDGET ONLY WHEN CREATING A WITHDRAWAL #}@@ -155,7 +155,7 @@{{ ExpandedForm.text('tags', tags) }}{# RELATE THIS TRANSFER TO A PIGGY BANK #}- {{ ExpandedForm.piggyBankList('piggy_bank_id',piggyBankId) }}+ {{ PiggyBankForm.piggyBankList('piggy_bank_id',piggyBankId) }}</div></div></div>diff --git a/resources/views/v1/rules/rule-group/delete.twig b/resources/views/v1/rules/rule-group/delete.twigindex 4b5618bc9e..332cd444c1 100644--- a/resources/views/v1/rules/rule-group/delete.twig+++ b/resources/views/v1/rules/rule-group/delete.twig@@ -35,7 +35,7 @@</p><p>- {{ ExpandedForm.ruleGroupListWithEmpty('move_rules_before_delete',null, {'hidden': ruleGroup.id}) }}+ {{ RuleForm.ruleGroupListWithEmpty('move_rules_before_delete',null, {'hidden': ruleGroup.id}) }}</p>{% else %}<input type="hidden" name="move_rules_before_delete" value="0"/>diff --git a/resources/views/v1/rules/rule/create.twig b/resources/views/v1/rules/rule/create.twigindex 18d3510993..8a9bc42327 100644--- a/resources/views/v1/rules/rule/create.twig+++ b/resources/views/v1/rules/rule/create.twig@@ -38,7 +38,7 @@<div class="box-body">{{ ExpandedForm.text('title') }}{{ ExpandedForm.select('trigger',allJournalTriggers()) }}- {{ ExpandedForm.ruleGroupList('rule_group_id', ruleGroup.id) }}+ {{ RuleForm.ruleGroupList('rule_group_id', ruleGroup.id) }}{{ ExpandedForm.checkbox('stop_processing',1,null, {helpText: trans('firefly.rule_help_stop_processing')}) }}{{ ExpandedForm.checkbox('strict',1, null,{helpText: trans('firefly.rule_help_strict')}) }}</div>diff --git a/resources/views/v1/rules/rule/edit.twig b/resources/views/v1/rules/rule/edit.twigindex efe3182b87..31fe3dddfd 100644--- a/resources/views/v1/rules/rule/edit.twig+++ b/resources/views/v1/rules/rule/edit.twig@@ -15,7 +15,7 @@</div><div class="box-body">{{ ExpandedForm.text('title') }}- {{ ExpandedForm.ruleGroupList('rule_group_id', ruleGroup.id) }}+ {{ RuleForm.ruleGroupList('rule_group_id', ruleGroup.id) }}{{ ExpandedForm.select('trigger',allJournalTriggers(), primaryTrigger) }}{# only correct way to do active checkbox #}