New view and what-not for feature.

This commit is contained in:
Sander Dorigo
2014-10-12 08:19:18 +02:00
parent 287c2e7af8
commit 5f4db7874c
6 changed files with 101 additions and 5 deletions

View File

@@ -21,7 +21,7 @@ class RecurringController extends BaseController
public function __construct(RTR $repository, RI $helper)
{
$this->_repository = $repository;
$this->_helper = $helper;
$this->_helper = $helper;
View::share('title', 'Recurring transactions');
View::share('mainTitleIcon', 'fa-rotate-right');
@@ -102,6 +102,27 @@ class RecurringController extends BaseController
}
/**
* @param RecurringTransaction $recurringTransaction
* @return mixed
*/
public function rescan(RecurringTransaction $recurringTransaction)
{
// do something!
/** @var \Firefly\Storage\TransactionJournal\TransactionJournalRepositoryInterface $repo */
$repo = App::make('Firefly\Storage\TransactionJournal\TransactionJournalRepositoryInterface');
$set = $repo->get();
/** @var TransactionJournal $journal */
foreach ($set as $journal) {
Event::fire('recurring.rescan', [$recurringTransaction, $journal]);
}
Session::flash('success','Rescanned everything.');
return Redirect::back();
}
public function store()
{
$data = Input::except(['_token', 'post_submit_action']);
@@ -170,14 +191,14 @@ class RecurringController extends BaseController
Session::flash('error', 'Could not update recurring transaction: ' . $messageBag->first());
return Redirect::route('transactions.edit', $recurringTransaction->id)->withInput()
->withErrors($messageBag);
->withErrors($messageBag);
}
break;
case 'validate_only':
$data = Input::all();
$data['id'] = $recurringTransaction->id;
$data = Input::all();
$data['id'] = $recurringTransaction->id;
$messageBags = $this->_helper->validate($data);
Session::flash('warnings', $messageBags['warnings']);