From c8dd9354602d54a7d5656a667e8c8ad82abef379 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 11 Sep 2014 15:19:07 +0200 Subject: [PATCH 1/3] Better feedback. --- app/controllers/MigrateController.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/MigrateController.php b/app/controllers/MigrateController.php index b773793399..082e854a63 100644 --- a/app/controllers/MigrateController.php +++ b/app/controllers/MigrateController.php @@ -30,7 +30,15 @@ class MigrateController extends BaseController // so now Firefly pushes something in a queue and does something with it! Yay! \Log::debug('Pushed a job to start the import.'); Queue::push('Firefly\Queue\Import@start', ['file' => $fullName, 'user' => \Auth::user()->id]); - Session::flash('success', 'The import job has been queued. Please be patient. Data will appear'); + if (Config::get('queue.default') == 'sync') { + Session::flash('success', 'Your data has been imported!'); + } else { + Session::flash( + 'success', + 'The import job has been queued. Please be patient. Data will appear slowly. Please be patient.' + ); + } + return Redirect::route('index'); } Session::flash('error', 'Could not save file to storage.'); From 0eadfa1c83ca4f60c550fbf84f83e6f6682fcc92 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 11 Sep 2014 15:19:18 +0200 Subject: [PATCH 2/3] Lighter chart. --- app/lib/Firefly/Helper/Controllers/Chart.php | 35 ++++++++++++-------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/app/lib/Firefly/Helper/Controllers/Chart.php b/app/lib/Firefly/Helper/Controllers/Chart.php index 991a76de6b..d9664d8595 100644 --- a/app/lib/Firefly/Helper/Controllers/Chart.php +++ b/app/lib/Firefly/Helper/Controllers/Chart.php @@ -25,13 +25,20 @@ class Chart implements ChartInterface { $current = clone $start; $today = new Carbon; - $return = ['name' => $account->name, 'id' => $account->id, 'data' => []]; + $return = [ + 'name' => $account->name, + 'id' => $account->id, + 'type' => 'spline', + 'pointStart' => $start->timestamp * 1000, + 'pointInterval' => 24 * 3600 * 1000, // one day + 'data' => [] + ]; while ($current <= $end) { if ($current > $today) { - $return['data'][] = [$current->timestamp * 1000, $account->predict(clone $current)]; + $return['data'][] = $account->predict(clone $current); } else { - $return['data'][] = [$current->timestamp * 1000, $account->balance(clone $current)]; + $return['data'][] = $account->balance(clone $current); } $current->addDay(); @@ -561,19 +568,21 @@ class Chart implements ChartInterface * * @return mixed */ - public function spentOnLimitRepetitionBetweenDates(\LimitRepetition $repetition, Carbon $start, Carbon $end) { + public function spentOnLimitRepetitionBetweenDates(\LimitRepetition $repetition, Carbon $start, Carbon $end) + { return floatval( \Transaction:: - leftJoin('transaction_journals', 'transaction_journals.id', '=','transactions.transaction_journal_id') - ->leftJoin('component_transaction_journal', 'component_transaction_journal.transaction_journal_id','=', - 'transaction_journals.id' - )->where('component_transaction_journal.component_id', '=', $repetition->limit->budget->id)->where( - 'transaction_journals.date', '>=', $start->format('Y-m-d') - )->where('transaction_journals.date', '<=', $end->format('Y-m-d'))->where( - 'amount', '>', 0 - )->sum('amount')) ; + leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') + ->leftJoin( + 'component_transaction_journal', 'component_transaction_journal.transaction_journal_id', '=', + 'transaction_journals.id' + )->where('component_transaction_journal.component_id', '=', $repetition->limit->budget->id)->where( + 'transaction_journals.date', '>=', $start->format('Y-m-d') + )->where('transaction_journals.date', '<=', $end->format('Y-m-d'))->where( + 'amount', '>', 0 + )->sum('amount') + ); } - } \ No newline at end of file From e1a2b4b9af1d43fa137e96d0e4b51bae0a7d7f43 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 11 Sep 2014 15:19:30 +0200 Subject: [PATCH 3/3] Fixed a bug that would stop you from registering. --- app/lib/Firefly/Helper/Email/EmailHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/Firefly/Helper/Email/EmailHelper.php b/app/lib/Firefly/Helper/Email/EmailHelper.php index 1967688d5f..f0c038182a 100644 --- a/app/lib/Firefly/Helper/Email/EmailHelper.php +++ b/app/lib/Firefly/Helper/Email/EmailHelper.php @@ -38,7 +38,7 @@ class EmailHelper implements EmailHelperInterface { $password = \Str::random(12); - $user->password = \Hash::make($password); + $user->password = $password; $user->reset = \Str::random(32); // new one. $user->forceSave(); $email = $user->email;