Merge branch 'release/5.1.0-alpha.1'

This commit is contained in:
James Cole
2020-02-16 06:57:52 +01:00
698 changed files with 6568 additions and 2399 deletions

View File

@@ -15,3 +15,4 @@ el_GR
sv_SE sv_SE
zh-hans_CN zh-hans_CN
zh-hant_CN zh-hant_CN
fi_FI

View File

@@ -15,6 +15,12 @@ SITE_OWNER=mail@example.com
# If you use Docker or similar, you can set this variable from a file by using APP_KEY_FILE # If you use Docker or similar, you can set this variable from a file by using APP_KEY_FILE
APP_KEY=SomeRandomStringOf32CharsExactly APP_KEY=SomeRandomStringOf32CharsExactly
#
# Firefly III will launch using this language (for new users and unauthenticated visitors)
# For a list of available languages: https://github.com/firefly-iii/firefly-iii/tree/master/resources/lang
#
# If text is still in English, remember that not everything may have been translated.
DEFAULT_LANGUAGE=en_US
# Change this value to your preferred time zone. # Change this value to your preferred time zone.
# Example: Europe/Amsterdam # Example: Europe/Amsterdam
@@ -48,6 +54,7 @@ APP_LOG_LEVEL=notice
# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III # Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III
# For other database types, please see the FAQ: https://docs.firefly-iii.org/support/faq # For other database types, please see the FAQ: https://docs.firefly-iii.org/support/faq
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE # If you use Docker or similar, you can set these variables from a file by appending them with _FILE
# Use "mysql" for MySQL and MariaDB. Use "sqlite" for SQLite.
DB_CONNECTION=pgsql DB_CONNECTION=pgsql
DB_HOST=firefly_iii_db DB_HOST=firefly_iii_db
DB_PORT=5432 DB_PORT=5432
@@ -73,7 +80,8 @@ SESSION_DRIVER=file
REDIS_HOST=127.0.0.1 REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null REDIS_PASSWORD=null
REDIS_PORT=6379 REDIS_PORT=6379
REDIS_DB="0" # always use quotes # always use quotes and make sure redis db "0" and "1" exists. Otherwise change accordingly.
REDIS_DB="0"
REDIS_CACHE_DB="1" REDIS_CACHE_DB="1"
# Cookie settings. Should not be necessary to change these. # Cookie settings. Should not be necessary to change these.
@@ -206,6 +214,11 @@ DISABLE_CSP_HEADER=false
TRACKER_SITE_ID= TRACKER_SITE_ID=
TRACKER_URL= TRACKER_URL=
#
# Firefly III could (in the future) collect telemetry on how you use Firefly III.
# In order to allow this, change the following variable to true:
SEND_TELEMETRY=false
# You can fine tune the start-up of a Docker container by editing these environment variables. # You can fine tune the start-up of a Docker container by editing these environment variables.
# Use this at your own risk. Disabling certain checks and features may result in lost of inconsistent data. # Use this at your own risk. Disabling certain checks and features may result in lost of inconsistent data.
# However if you know what you're doing you can significantly speed up container start times. # However if you know what you're doing you can significantly speed up container start times.

View File

@@ -90,12 +90,12 @@ class CategoryController extends Controller
$tempData = []; $tempData = [];
$spentWith = $this->opsRepository->listExpenses($start, $end); $spentWith = $this->opsRepository->listExpenses($start, $end);
$earnedWith = $this->opsRepository->listIncome($start, $end); $earnedWith = $this->opsRepository->listIncome($start, $end);
$spentWithout = $this->noCatRepository->listExpenses($start, $end); $spentWithout = $this->noCatRepository->listExpenses($start, $end); // refactored
$earnedWithout = $this->noCatRepository->listIncome($start, $end); $earnedWithout = $this->noCatRepository->listIncome($start, $end); // refactored
$categories = []; $categories = [];
foreach ([$spentWith, $earnedWith] as $set) { foreach ([$spentWith, $earnedWith, $spentWithout, $earnedWithout] as $set) {
foreach ($set as $currency) { foreach ($set as $currency) {
foreach ($currency['categories'] as $category) { foreach ($currency['categories'] as $category) {
$categories[] = $category['name']; $categories[] = $category['name'];
@@ -141,48 +141,48 @@ class CategoryController extends Controller
} }
} }
foreach ([$spentWithout, $earnedWithout] as $set) { // foreach ([] as $set) {
foreach ($set as $currency) { // foreach ($set as $currency) {
$inKey = sprintf('%d-i', $currency['currency_id']); // $inKey = sprintf('%d-i', $currency['currency_id']);
$outKey = sprintf('%d-e', $currency['currency_id']); // $outKey = sprintf('%d-e', $currency['currency_id']);
$categories[] = (string)trans('firefly.no_category'); // $categories[] = (string)trans('firefly.no_category');
// make data arrays if not yet present. // // make data arrays if not yet present.
$tempData[$inKey] = $tempData[$inKey] ?? [ // $tempData[$inKey] = $tempData[$inKey] ?? [
'currency_id' => $currency['currency_id'], // 'currency_id' => $currency['currency_id'],
'label' => (string)trans('firefly.box_earned_in_currency', ['currency' => $currency['currency_name']]), // 'label' => (string)trans('firefly.box_earned_in_currency', ['currency' => $currency['currency_name']]),
'currency_code' => $currency['currency_code'], // 'currency_code' => $currency['currency_code'],
'currency_symbol' => $currency['currency_symbol'], // 'currency_symbol' => $currency['currency_symbol'],
'currency_decimal_places' => $currency['currency_decimal_places'], // 'currency_decimal_places' => $currency['currency_decimal_places'],
'type' => 'bar', // line, area or bar // 'type' => 'bar', // line, area or bar
'yAxisID' => 0, // 0, 1, 2 // 'yAxisID' => 0, // 0, 1, 2
'entries' => [ // 'entries' => [
// per category: // // per category:
// "category" => 5, // // "category" => 5,
], // ],
]; // ];
$tempData[$outKey] = $tempData[$outKey] ?? [ // $tempData[$outKey] = $tempData[$outKey] ?? [
'currency_id' => $currency['currency_id'], // 'currency_id' => $currency['currency_id'],
'label' => (string)trans('firefly.box_spent_in_currency', ['currency' => $currency['currency_name']]), // 'label' => (string)trans('firefly.box_spent_in_currency', ['currency' => $currency['currency_name']]),
'currency_code' => $currency['currency_code'], // 'currency_code' => $currency['currency_code'],
'currency_symbol' => $currency['currency_symbol'], // 'currency_symbol' => $currency['currency_symbol'],
'currency_decimal_places' => $currency['currency_decimal_places'], // 'currency_decimal_places' => $currency['currency_decimal_places'],
'type' => 'bar', // line, area or bar // 'type' => 'bar', // line, area or bar
'yAxisID' => 0, // 0, 1, 2 // 'yAxisID' => 0, // 0, 1, 2
'entries' => [ // 'entries' => [
// per category: // // per category:
// "category" => 5, // // "category" => 5,
], // ],
]; // ];
foreach ($currency['transaction_journals'] as $journal) { // foreach ($currency['transaction_journals'] as $journal) {
// is it expense or income? // // is it expense or income?
$letter = -1 === bccomp($journal['amount'], '0') ? 'e' : 'i'; // $letter = -1 === bccomp($journal['amount'], '0') ? 'e' : 'i';
$currentKey = sprintf('%d-%s', $currency['currency_id'], $letter); // $currentKey = sprintf('%d-%s', $currency['currency_id'], $letter);
$name = (string)trans('firefly.no_category'); // $name = (string)trans('firefly.no_category');
$tempData[$currentKey]['entries'][$name] = $tempData[$currentKey]['entries'][$name] ?? '0'; // $tempData[$currentKey]['entries'][$name] = $tempData[$currentKey]['entries'][$name] ?? '0';
$tempData[$currentKey]['entries'][$name] = bcadd($tempData[$currentKey]['entries'][$name], $journal['amount']); // $tempData[$currentKey]['entries'][$name] = bcadd($tempData[$currentKey]['entries'][$name], $journal['amount']);
} // }
} // }
} // }
// re-sort every spent array and add 0 for missing entries. // re-sort every spent array and add 0 for missing entries.
foreach ($tempData as $index => $set) { foreach ($tempData as $index => $set) {

View File

@@ -318,6 +318,10 @@ class CurrencyController extends Controller
if ($this->repository->currencyInUse($currency)) { if ($this->repository->currencyInUse($currency)) {
throw new FireflyException('200006: Currency in use.'); // @codeCoverageIgnore throw new FireflyException('200006: Currency in use.'); // @codeCoverageIgnore
} }
if ($this->repository->isFallbackCurrency($currency)) {
throw new FireflyException('200026: Currency is fallback.'); // @codeCoverageIgnore
}
$this->repository->destroy($currency); $this->repository->destroy($currency);
return response()->json([], 204); return response()->json([], 204);

View File

@@ -57,8 +57,8 @@ class AttachmentStoreRequest extends Request
'filename' => $this->string('filename'), 'filename' => $this->string('filename'),
'title' => $this->string('title'), 'title' => $this->string('title'),
'notes' => $this->nlString('notes'), 'notes' => $this->nlString('notes'),
'model' => $this->string('model'), 'model' => $this->string('attachable_type'),
'model_id' => $this->integer('model_id'), 'model_id' => $this->integer('attachable_id'),
]; ];
} }
@@ -77,14 +77,14 @@ class AttachmentStoreRequest extends Request
str_replace('FireflyIII\\Models\\', '', TransactionJournal::class), str_replace('FireflyIII\\Models\\', '', TransactionJournal::class),
] ]
); );
$model = $this->string('model'); $model = $this->string('attachable_type');
return [ return [
'filename' => 'required|between:1,255', 'filename' => 'required|between:1,255',
'title' => 'between:1,255', 'title' => 'between:1,255',
'notes' => 'between:1,65000', 'notes' => 'between:1,65000',
'model' => sprintf('required|in:%s', $models), 'attachable_type' => sprintf('required|in:%s', $models),
'model_id' => ['required', 'numeric', new IsValidAttachmentModel($model)], 'attachable_id' => ['required', 'numeric', new IsValidAttachmentModel($model)],
]; ];
} }
} }

View File

@@ -52,8 +52,8 @@ class AttachmentUpdateRequest extends Request
'filename' => $this->string('filename'), 'filename' => $this->string('filename'),
'title' => $this->string('title'), 'title' => $this->string('title'),
'notes' => $this->nlString('notes'), 'notes' => $this->nlString('notes'),
'model' => $this->string('model'), 'model' => $this->string('attachable_type'),
'model_id' => $this->integer('model_id'), 'model_id' => $this->integer('attachable_id'),
]; ];
} }

View File

@@ -90,11 +90,40 @@ class FixUnevenAmount extends Command
} }
/** @var Transaction $source */ /** @var Transaction $source */
$source = $journal->transactions()->where('amount', '<', 0)->first(); $source = $journal->transactions()->where('amount', '<', 0)->first();
if (null === $source) {
$this->error(
sprintf(
'Journal #%d ("%s") has no source transaction. It will be deleted to maintain database consistency.', $journal->id ?? 0,
$journal->description ?? ''
)
);
Transaction::where('transaction_journal_id', $journal->id ?? 0)->forceDelete();
TransactionJournal::where('id', $journal->description ?? 0)->forceDelete();
return;
}
$amount = bcmul('-1', (string)$source->amount); $amount = bcmul('-1', (string)$source->amount);
// fix amount of destination: // fix amount of destination:
/** @var Transaction $destination */ /** @var Transaction $destination */
$destination = $journal->transactions()->where('amount', '>', 0)->first(); $destination = $journal->transactions()->where('amount', '>', 0)->first();
if (null === $destination) {
$this->error(
sprintf(
'Journal #%d ("%s") has no destination transaction. It will be deleted to maintain database consistency.', $journal->id ?? 0,
$journal->description ?? ''
)
);
Transaction::where('transaction_journal_id', $journal->id ?? 0)->forceDelete();
TransactionJournal::where('id', $journal->description ?? 0)->forceDelete();
return;
}
$destination->amount = $amount; $destination->amount = $amount;
$destination->save(); $destination->save();

View File

@@ -55,10 +55,11 @@ class CreateDatabase extends Command
{ {
if ('mysql' !== env('DB_CONNECTION')) { if ('mysql' !== env('DB_CONNECTION')) {
$this->info(sprintf('CreateDB does not apply to "%s", skipped.', env('DB_CONNECTION'))); $this->info(sprintf('CreateDB does not apply to "%s", skipped.', env('DB_CONNECTION')));
return 0; return 0;
} }
// try to set up a raw connection: // try to set up a raw connection:
$dsn = sprintf('mysql:host=%s;charset=utf8mb4', env('DB_HOST')); $dsn = sprintf('mysql:host=%s;port=%d;charset=utf8mb4', env('DB_HOST', 'localhost'), env('DB_PORT', '3306'));
$options = [ $options = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,

View File

@@ -32,7 +32,7 @@ class SetLatestVersion extends Command
* *
* @var string * @var string
*/ */
protected $description = 'Command description'; protected $description = 'Set latest version in DB.';
/** /**
* The name and signature of the console command. * The name and signature of the console command.
* *

View File

@@ -2,7 +2,7 @@
/** /**
* AdminRequestedTestMessage.php * AdminRequestedTestMessage.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -2,7 +2,7 @@
/** /**
* Event.php * Event.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -2,7 +2,7 @@
/** /**
* RegisteredUser.php * RegisteredUser.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -2,7 +2,7 @@
/** /**
* RequestedNewPassword.php * RequestedNewPassword.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -2,7 +2,7 @@
/** /**
* RequestedReportOnJournals.php * RequestedReportOnJournals.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -2,7 +2,7 @@
/** /**
* RequestedVersionCheckStatus.php * RequestedVersionCheckStatus.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -2,7 +2,7 @@
/** /**
* StoredTransactionGroup.php * StoredTransactionGroup.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -2,7 +2,7 @@
/** /**
* UpdatedTransactionGroup.php * UpdatedTransactionGroup.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -2,7 +2,7 @@
/** /**
* UserChangedEmail.php * UserChangedEmail.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* DuplicateTransactionException.php * DuplicateTransactionException.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -2,7 +2,7 @@
/** /**
* FireflyException.php * FireflyException.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* GracefulNotFoundHandler.php * GracefulNotFoundHandler.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *
@@ -85,6 +85,7 @@ class GracefulNotFoundHandler extends ExceptionHandler
return redirect(route('currencies.index')); return redirect(route('currencies.index'));
break; break;
case 'budgets.show': case 'budgets.show':
case 'budgets.edit':
$request->session()->reflash(); $request->session()->reflash();
return redirect(route('budgets.index')); return redirect(route('budgets.index'));

View File

@@ -2,7 +2,7 @@
/** /**
* Handler.php * Handler.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -2,7 +2,7 @@
/** /**
* NotImplementedException.php * NotImplementedException.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -2,7 +2,7 @@
/** /**
* ValidationException.php * ValidationException.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* ChartJsGenerator.php * ChartJsGenerator.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *
@@ -32,6 +32,7 @@ class ChartJsGenerator implements GeneratorInterface
{ {
/** /**
* Constructor. * Constructor.
*
* @codeCoverageIgnore * @codeCoverageIgnore
*/ */
public function __construct() public function __construct()
@@ -119,6 +120,9 @@ class ChartJsGenerator implements GeneratorInterface
{ {
reset($data); reset($data);
$first = current($data); $first = current($data);
if (!is_array($first)) {
return [];
}
$labels = is_array($first['entries']) ? array_keys($first['entries']) : []; $labels = is_array($first['entries']) ? array_keys($first['entries']) : [];
$chartData = [ $chartData = [

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* GeneratorInterface.php * GeneratorInterface.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* MonthReportGenerator.php * MonthReportGenerator.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* MultiYearReportGenerator.php * MultiYearReportGenerator.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* YearReportGenerator.php * YearReportGenerator.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* MonthReportGenerator.php * MonthReportGenerator.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* MultiYearReportGenerator.php * MultiYearReportGenerator.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* YearReportGenerator.php * YearReportGenerator.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* MonthReportGenerator.php * MonthReportGenerator.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* MultiYearReportGenerator.php * MultiYearReportGenerator.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* YearReportGenerator.php * YearReportGenerator.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* MonthReportGenerator.php * MonthReportGenerator.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* MultiYearReportGenerator.php * MultiYearReportGenerator.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* YearReportGenerator.php * YearReportGenerator.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* ReportGeneratorFactory.php * ReportGeneratorFactory.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* ReportGeneratorInterface.php * ReportGeneratorInterface.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* MonthReportGenerator.php * MonthReportGenerator.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* MultiYearReportGenerator.php * MultiYearReportGenerator.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* YearReportGenerator.php * YearReportGenerator.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* MonthReportGenerator.php * MonthReportGenerator.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* MultiYearReportGenerator.php * MultiYearReportGenerator.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* YearReportGenerator.php * YearReportGenerator.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* APIEventHandler.php * APIEventHandler.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* AdminEventHandler.php * AdminEventHandler.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* AutomationHandler.php * AutomationHandler.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* StoredGroupEventHandler.php * StoredGroupEventHandler.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* UpdatedGroupEventHandler.php * UpdatedGroupEventHandler.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* UserEventHandler.php * UserEventHandler.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* VersionCheckEventHandler.php * VersionCheckEventHandler.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *
@@ -25,6 +25,7 @@ declare(strict_types=1);
namespace FireflyIII\Handlers\Events; namespace FireflyIII\Handlers\Events;
use Carbon\Carbon;
use FireflyIII\Events\RequestedVersionCheckStatus; use FireflyIII\Events\RequestedVersionCheckStatus;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Update\UpdateTrait; use FireflyIII\Helpers\Update\UpdateTrait;
@@ -55,7 +56,6 @@ class VersionCheckEventHandler
$value = (int)$permission->data; $value = (int)$permission->data;
if (1 !== $value) { if (1 !== $value) {
Log::info('Update check is not enabled.'); Log::info('Update check is not enabled.');
return; return;
} }
@@ -65,7 +65,6 @@ class VersionCheckEventHandler
$user = $event->user; $user = $event->user;
if (!$repository->hasRole($user, 'owner')) { if (!$repository->hasRole($user, 'owner')) {
Log::debug('User is not admin, done.'); Log::debug('User is not admin, done.');
return; return;
} }
@@ -76,26 +75,13 @@ class VersionCheckEventHandler
Log::debug(sprintf('Last check time is %d, current time is %d, difference is %d', $lastCheckTime->data, $now, $diff)); Log::debug(sprintf('Last check time is %d, current time is %d, difference is %d', $lastCheckTime->data, $now, $diff));
if ($diff < 604800) { if ($diff < 604800) {
Log::debug(sprintf('Checked for updates less than a week ago (on %s).', date('Y-m-d H:i:s', $lastCheckTime->data))); Log::debug(sprintf('Checked for updates less than a week ago (on %s).', date('Y-m-d H:i:s', $lastCheckTime->data)));
return; return;
} }
// last check time was more than a week ago. // last check time was more than a week ago.
Log::debug('Have not checked for a new version in a week!'); Log::debug('Have not checked for a new version in a week!');
try { $release = $this->getLatestRelease();
$latestRelease = $this->getLatestRelease();
} catch (FireflyException $e) {
Log::error($e);
session()->flash('error', (string)trans('firefly.update_check_error'));
// softfail. session()->flash($release['level'], $release['message']);
return;
}
$versionCheck = $this->versionCheck($latestRelease);
$resultString = $this->parseResult($versionCheck, $latestRelease);
if (0 !== $versionCheck && '' !== $resultString) {
// flash info
session()->flash('info', $resultString);
}
app('fireflyconfig')->set('last_update_check', time()); app('fireflyconfig')->set('last_update_check', time());
} }
} }

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* AttachmentHelper.php * AttachmentHelper.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* AttachmentHelperInterface.php * AttachmentHelperInterface.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* GroupCollector.php * GroupCollector.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* GroupCollectorInterface.php * GroupCollectorInterface.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* FiscalHelper.php * FiscalHelper.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* FiscalHelperInterface.php * FiscalHelperInterface.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* Help.php * Help.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* HelpInterface.php * HelpInterface.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* NetWorth.php * NetWorth.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* NetWorthInterface.php * NetWorthInterface.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* PopupReport.php * PopupReport.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* PopupReportInterface.php * PopupReportInterface.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* ReportHelper.php * ReportHelper.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* ReportHelperInterface.php * ReportHelperInterface.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* UpdateTrait.php * UpdateTrait.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *
@@ -23,8 +23,6 @@ declare(strict_types=1);
namespace FireflyIII\Helpers\Update; namespace FireflyIII\Helpers\Update;
use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Services\FireflyIIIOrg\Update\UpdateRequestInterface; use FireflyIII\Services\FireflyIIIOrg\Update\UpdateRequestInterface;
use Log; use Log;
@@ -35,10 +33,11 @@ use Log;
trait UpdateTrait trait UpdateTrait
{ {
/** /**
* Get object for the latest release from GitHub. * Returns an array with info on the next release, if any.
* 'message' => 'A new version is available.
* 'level' => 'info' / 'success' / 'error'
* *
* @return array * @return array
* @throws FireflyException
*/ */
public function getLatestRelease(): array public function getLatestRelease(): array
{ {
@@ -47,81 +46,6 @@ trait UpdateTrait
$checker = app(UpdateRequestInterface::class); $checker = app(UpdateRequestInterface::class);
$channel = app('fireflyconfig')->get('update_channel', 'stable')->data; $channel = app('fireflyconfig')->get('update_channel', 'stable')->data;
return $checker->getVersion($channel); return $checker->getUpdateInformation($channel);
}
/**
* Parses the version check result in a human readable sentence.
*
* @param int $versionCheck
* @param array $information
*
* @return string
*/
public function parseResult(int $versionCheck, array $information): string
{
Log::debug(sprintf('Now in parseResult(%d)', $versionCheck));
$current = (string)config('firefly.version');
$return = '';
$triggered = false;
if (-1 === $versionCheck) {
$triggered = true;
$monthAndDayFormat = (string)trans('config.month_and_day');
$carbon = Carbon::createFromFormat('Y-m-d', $information['date']);
$return = (string)trans(
'firefly.update_new_version_alert',
[
'your_version' => $current,
'new_version' => $information['version'],
'date' => $carbon->formatLocalized($monthAndDayFormat),
]
);
// append warning if beta or alpha.
$isBeta = $information['is_beta'] ?? false;
if (true === $isBeta) {
$return = sprintf('%s %s', $return, trans('firefly.update_version_beta'));
}
$isAlpha = $information['is_alpha'] ?? false;
if (true === $isAlpha) {
$return = sprintf('%s %s', $return, trans('firefly.update_version_alpha'));
}
}
if (0 === $versionCheck) {
$triggered = true;
Log::debug('User is running current version.');
// you are running the current version!
$return = (string)trans('firefly.update_current_version_alert', ['version' => $current]);
}
if (1 === $versionCheck) {
$triggered = true;
Log::debug('User is running NEWER version.');
// you are running a newer version!
$return = (string)trans('firefly.update_newer_version_alert', ['your_version' => $current, 'new_version' => $information['version']]);
}
if (false === $triggered) {
Log::debug('No option was triggered.');
$return = (string)trans('firefly.update_check_error');
}
return $return;
}
/**
* Compare version and store result.
*
* @param array $information
*
* @return int
*/
public function versionCheck(array $information): int
{
Log::debug('Now in versionCheck()');
$current = (string)config('firefly.version');
$check = version_compare($current, $information['version']);
Log::debug(sprintf('Comparing %s with %s, result is %s', $current, $information['version'], $check), $information);
return $check;
} }
} }

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* CreateController.php * CreateController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* DeleteController.php * DeleteController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* EditController.php * EditController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* IndexController.php * IndexController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* ReconcileController.php * ReconcileController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* ShowController.php * ShowController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* ConfigurationController.php * ConfigurationController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* HomeController.php * HomeController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* LinkController.php * LinkController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* UpdateController.php * UpdateController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *
@@ -23,14 +23,12 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Admin; namespace FireflyIII\Http\Controllers\Admin;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Update\UpdateTrait; use FireflyIII\Helpers\Update\UpdateTrait;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Middleware\IsDemoUser; use FireflyIII\Http\Middleware\IsDemoUser;
use FireflyIII\Http\Middleware\IsSandStormUser; use FireflyIII\Http\Middleware\IsSandStormUser;
use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Log;
/** /**
* Class HomeController. * Class HomeController.
@@ -110,46 +108,12 @@ class UpdateController extends Controller
/** /**
* Does a manual update check. * Does a manual update check.
*/ */
public function updateCheck(): JsonResponse public function updateCheck(): RedirectResponse
{ {
$success = true; $release = $this->getLatestRelease();
$latestRelease = '1.0';
$resultString = '';
$versionCheck = -2;
$channel = app('fireflyconfig')->get('update_channel', 'stable')->data;
try { session()->flash($release['level'], $release['message']);
$latestRelease = $this->getLatestRelease();
} catch (FireflyException $e) {
Log::error($e->getMessage());
$success = false;
}
// if error, tell the user. return redirect(route('admin.update-check'));
if (false === $success) {
$resultString = (string)trans('firefly.update_check_error');
session()->flash('error', $resultString);
}
// if not, compare and tell the user.
if (true === $success) {
$versionCheck = $this->versionCheck($latestRelease);
$resultString = $this->parseResult($versionCheck, $latestRelease);
}
Log::debug(sprintf('Result string is: "%s"', $resultString));
if (0 !== $versionCheck && '' !== $resultString) {
// flash info
session()->flash('info', $resultString);
}
app('fireflyconfig')->set('last_update_check', time());
return response()->json(
[
'result' => $resultString,
'channel' => $channel,
]
);
} }
} }

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* UserController.php * UserController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* AttachmentController.php * AttachmentController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -3,7 +3,7 @@
/** /**
* ConfirmPasswordController.php * ConfirmPasswordController.php
* Copyright (c) 2020 thegrumpydictator@gmail.com * Copyright (c) 2020 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* ForgotPasswordController.php * ForgotPasswordController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* LoginController.php * LoginController.php
* Copyright (c) 2020 thegrumpydictator@gmail.com * Copyright (c) 2020 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* RegisterController.php * RegisterController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* ResetPasswordController.php * ResetPasswordController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* TwoFactorController.php * TwoFactorController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* BillController.php * BillController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* AvailableBudgetController.php * AvailableBudgetController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* BudgetLimitController.php * BudgetLimitController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *
@@ -179,7 +179,7 @@ class BudgetLimitController extends Controller
return response()->json($array); return response()->json($array);
} }
return redirect(route('budgets.index')); return redirect(route('budgets.index', [$start->format('Y-m-d'), $end->format('Y-m-d')]));
} }
/** /**

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* CreateController.php * CreateController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* DeleteController.php * DeleteController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* EditController.php * EditController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* IndexController.php * IndexController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* ShowController.php * ShowController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* CreateController.php * CreateController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* DeleteController.php * DeleteController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* EditController.php * EditController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* IndexController.php * IndexController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* NoCategoryController.php * NoCategoryController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* ShowController.php * ShowController.php
* Copyright (c) 2019 thegrumpydictator@gmail.com * Copyright (c) 2019 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
* *

Some files were not shown because too many files have changed in this diff Show More