Skip to content

Firefly III: a personal finances manager

New buttons.

Sander Dorigo1e76a5fc3f69
diff --git a/app/controllers/TransactionController.php b/app/controllers/TransactionController.php
index a2b385c330..798ca809ae 100644
--- a/app/controllers/TransactionController.php
+++ b/app/controllers/TransactionController.php
@@ -67,6 +67,18 @@ class TransactionController extends BaseController
$piggies = $toolkit->makeSelectList($piggyRepository->get());
$piggies[0] = '(no piggy bank)';
+ /*
+ * respond to a possible given values in the URL.
+ */
+ $prefilled = Session::has('prefilled') ? Session::get('prefilled') : [];
+ $respondTo = ['account_id', 'account_from_id'];
+ foreach ($respondTo as $r) {
+ if (!is_null(Input::get($r))) {
+ $prefilled[$r] = Input::get($r);
+ }
+ }
+ Session::put('prefilled', $prefilled);
+
return View::make('transactions.create')->with('accounts', $assetAccounts)->with('budgets', $budgets)->with(
'what', $what
)->with('piggies', $piggies)->with('subTitle', 'Add a new ' . $what);
diff --git a/app/lib/Firefly/Form/Form.php b/app/lib/Firefly/Form/Form.php
index fbb2f2b2fb..9673ea9172 100644
--- a/app/lib/Firefly/Form/Form.php
+++ b/app/lib/Firefly/Form/Form.php
@@ -190,6 +190,14 @@ class Form
*/
$options['placeholder'] = ucfirst($name);
+ /*
+ * Get prefilled value:
+ */
+ if(\Session::has('prefilled')) {
+ $prefilled = \Session::get('prefilled');
+ $value = isset($prefilled[$name]) ? $prefilled[$name] : null;
+ }
+
/*
* Get the value.
*/
diff --git a/app/views/index.blade.php b/app/views/index.blade.php
index 82e261d62f..de32cdf79a 100644
--- a/app/views/index.blade.php
+++ b/app/views/index.blade.php
@@ -82,6 +82,25 @@
<div class="panel-heading">
<i class="fa fa-money fa-fw"></i>
<a href="{{route('accounts.show',$data[1]->id)}}">{{{$data[1]->name}}}</a>
+
+
+ <!-- ACTIONS MENU -->
+ <div class="pull-right">
+ <div class="btn-group">
+ <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
+ Actions
+ <span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu pull-right" role="menu">
+ <li><a href="{{route('transactions.create','withdrawal')}}?account_id={{{$data[1]->id}}}"><i class="fa fa-long-arrow-left fa-fw"></i> New withdrawal</a></li>
+ <li><a href="{{route('transactions.create','deposit')}}?account_id={{{$data[1]->id}}}"><i class="fa fa-long-arrow-right fa-fw"></i> New deposit</a></li>
+ <li><a href="{{route('transactions.create','transfer')}}?account_from_id={{{$data[1]->id}}}"><i class="fa fa-arrows-h fa-fw"></i> New transfer</a></li>
+ </ul>
+ </div>
+ </div>
+
+
+
</div>
<div class="panel-body">
@include('transactions.journals-small-index',['transactions' => $data[0],'account' => $data[1]])