';
+ break;
+ case 'number':
+ $html .= \Form::input('number', $name, $value, $options);
+ break;
+ case 'checkbox':
+ $checked = $options['checked'];
+ unset($options['checked'], $options['placeholder'], $options['autocomplete'], $options['class']);
+ $html .= '';
+
+
+ break;
+ case 'date':
+ $html .= \Form::input('date', $name, $value, $options);
+ break;
+ case 'select':
+ $html .= \Form::select($name, $list, $value, $options);
+ break;
+ default:
+ throw new FireflyException('Cannot handle type "' . $type . '" in FFFormBuilder.');
+ break;
+ }
+
+ /*
+ * If errors, respond to them:
+ */
+
+ if (!is_null($errors)) {
+ if ($errors->has($name)) {
+ $html .= '';
+ $html .= '
' . e($errors->first($name)) . '
';
+ }
+ }
+ unset($errors);
+ /*
+ * If warnings, respond to them:
+ */
+
+ if (!is_null($warnings)) {
+ if ($warnings->has($name)) {
+ $html .= '';
+ $html .= '
' . e($warnings->first($name)) . '
';
+ }
+ }
+ unset($warnings);
+
+ /*
+ * If successes, respond to them:
+ */
+
+ if (!is_null($successes)) {
+ if ($successes->has($name)) {
+ $html .= '';
+ $html .= '
' . e($successes->first($name)) . '
';
+ }
+ }
+ unset($successes);
+
+ $html .= '
';
+ $html .= '
';
+
+ return $html;
+
+ }
+}
\ No newline at end of file
diff --git a/app/lib/FireflyIII/Shared/SingleTableInheritanceEntity.php b/app/lib/FireflyIII/Shared/SingleTableInheritanceEntity.php
new file mode 100644
index 0000000000..9787e02e40
--- /dev/null
+++ b/app/lib/FireflyIII/Shared/SingleTableInheritanceEntity.php
@@ -0,0 +1,121 @@
+mapData((array)$attributes)->newInstance([], true);
+ $instance->setRawAttributes((array)$attributes, true);
+
+ return $instance;
+ }
+
+
+ /**
+ * if no subclass is defined, function as normal
+ *
+ * @param array $attributes
+ *
+ * @return \Illuminate\Database\Eloquent\Model|static
+ */
+ public function mapData(array $attributes)
+ {
+ if (!$this->subclassField) {
+ return $this->newInstance();
+ }
+
+ return new $attributes[$this->subclassField];
+ }
+
+
+ /**
+ *
+ * instead of using $this->newInstance(), call
+ * newInstance() on the object from mapData
+ *
+ * @param bool $excludeDeleted
+ *
+ * @return \Illuminate\Database\Eloquent\Builder|static
+ */
+ public function newQuery($excludeDeleted = true)
+ {
+ // If using Laravel 4.0.x then use the following commented version of this command
+ // $builder = new Builder($this->newBaseQueryBuilder());
+ // newEloquentBuilder() was added in 4.1
+ $builder = $this->newEloquentBuilder($this->newBaseQueryBuilder());
+
+ // Once Firefly has the query builders, it will set the model instances so the
+ // builder can easily access any information it may need from the model
+ // while it is constructing and executing various queries against it.
+ $builder->setModel($this)->with($this->with);
+
+ if ($excludeDeleted && $this->softDelete) {
+ $builder->whereNull($this->getQualifiedDeletedAtColumn());
+ }
+
+ if ($this->subclassField && $this->isSubclass()) {
+ $builder->where($this->subclassField, '=', get_class($this));
+ }
+
+ return $builder;
+ }
+
+ /**
+ * @return bool
+ */
+ public function isSubclass()
+ {
+ return $this->isSubclass;
+ }
+
+ /**
+ * ensure that the subclass field is assigned on save
+ *
+ * @param array $rules
+ * @param array $customMessages
+ * @param array $options
+ * @param callable $beforeSave
+ * @param callable $afterSave
+ *
+ * @return bool
+ */
+ public function save(
+ array $rules = [],
+ array $customMessages = [],
+ array $options = [],
+ \Closure $beforeSave = null,
+ \Closure $afterSave = null
+ ) {
+ if ($this->subclassField) {
+ $this->attributes[$this->subclassField] = get_class($this);
+ }
+
+ return parent::save($rules, $customMessages, $options, $beforeSave, $afterSave);
+ }
+}
\ No newline at end of file
diff --git a/app/models/Component.php b/app/models/Component.php
index 9337fcced7..f0905fcb84 100644
--- a/app/models/Component.php
+++ b/app/models/Component.php
@@ -1,5 +1,5 @@
repeat_freq) {
default:
- throw new \Firefly\Exception\FireflyException(
- 'No date formats for frequency "' . $this->repeat_freq
- . '"!'
- );
+ throw new FireflyException('No date formats for frequency "' . $this->repeat_freq . '"!');
break;
case 'daily':
return $this->startdate->format('Ymd') . '-5';
@@ -119,10 +117,7 @@ class LimitRepetition extends Ardent
}
switch ($this->repeat_freq) {
default:
- throw new \Firefly\Exception\FireflyException(
- 'No date formats for frequency "' . $this->repeat_freq
- . '"!'
- );
+ throw new FireflyException('No date formats for frequency "' . $this->repeat_freq . '"!');
break;
case 'daily':
return $this->startdate->format('j F Y');
diff --git a/app/models/Reminder.php b/app/models/Reminder.php
index c2fb74936c..0d11a174f5 100644
--- a/app/models/Reminder.php
+++ b/app/models/Reminder.php
@@ -1,7 +1,6 @@
account_id == $piggybank->account_id) {
- $this->piggybank()->associate($piggybank);
- $this->save();
- \Event::fire('piggybanks.createRelatedTransfer', [$piggybank, $this->transactionJournal, $this]);
- return true;
- }
- return false;
+ throw new NotImplementedException;
+// if (is_null($piggybank)) {
+// return true;
+// }
+// /** @var \Firefly\Storage\Piggybank\PiggybankRepositoryInterface $piggyRepository */
+// $piggyRepository = \App::make('Firefly\Storage\Piggybank\PiggybankRepositoryInterface');
+// if ($this->account_id == $piggybank->account_id) {
+// $this->piggybank()->associate($piggybank);
+// $this->save();
+// \Event::fire('piggybanks.createRelatedTransfer', [$piggybank, $this->transactionJournal, $this]);
+// return true;
+// }
+// return false;
}
/**
diff --git a/app/start/global.php b/app/start/global.php
index 10109df498..6968b4dfba 100644
--- a/app/start/global.php
+++ b/app/start/global.php
@@ -74,47 +74,47 @@ App::down(
// forms:
\Form::macro(
'ffText', function ($name, $value = null, array $options = []) {
- return \Firefly\Form\Form::ffText($name, $value, $options);
+ return \FireflyIII\Form\Form::ffText($name, $value, $options);
}
);
\Form::macro(
'ffSelect', function ($name, array $list = [], $selected = null, array $options = []) {
- return \Firefly\Form\Form::ffSelect($name, $list, $selected, $options);
+ return \FireflyIII\Form\Form::ffSelect($name, $list, $selected, $options);
}
);
\Form::macro(
'ffInteger', function ($name, $value = null, array $options = []) {
- return \Firefly\Form\Form::ffInteger($name, $value, $options);
+ return \FireflyIII\Form\Form::ffInteger($name, $value, $options);
}
);
\Form::macro(
'ffAmount', function ($name, $value = null, array $options = []) {
- return \Firefly\Form\Form::ffAmount($name, $value, $options);
+ return \FireflyIII\Form\Form::ffAmount($name, $value, $options);
}
);
\Form::macro(
'ffBalance', function ($name, $value = null, array $options = []) {
- return \Firefly\Form\Form::ffBalance($name, $value, $options);
+ return \FireflyIII\Form\Form::ffBalance($name, $value, $options);
}
);
\Form::macro(
'ffDate', function ($name, $value = null, array $options = []) {
- return \Firefly\Form\Form::ffDate($name, $value, $options);
+ return \FireflyIII\Form\Form::ffDate($name, $value, $options);
}
);
\Form::macro(
'ffTags', function ($name, $value = null, array $options = []) {
- return \Firefly\Form\Form::ffTags($name, $value, $options);
+ return \FireflyIII\Form\Form::ffTags($name, $value, $options);
}
);
\Form::macro(
'ffCheckbox', function ($name, $value = 1, $checked = null, $options = []) {
- return \Firefly\Form\Form::ffCheckbox($name, $value, $checked, $options);
+ return \FireflyIII\Form\Form::ffCheckbox($name, $value, $checked, $options);
}
);
\Form::macro(
'ffOptionsList', function ($type, $name) {
- return \Firefly\Form\Form::ffOptionsList($type, $name);
+ return \FireflyIII\Form\Form::ffOptionsList($type, $name);
}
);
diff --git a/app/tests/TestCase.php b/app/tests/TestCase.php
index f6230dd2ef..872cc48bcc 100644
--- a/app/tests/TestCase.php
+++ b/app/tests/TestCase.php
@@ -11,7 +11,6 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
* Creates the application.
*
* @return \Symfony\Component\HttpKernel\HttpKernelInterface
- * @SuppressWarnings(PHPMD.UnusedLocalVariable)
*/
public function createApplication()
{
diff --git a/app/views/transactions/list.blade.php b/app/views/transactions/index.blade.php
similarity index 66%
rename from app/views/transactions/list.blade.php
rename to app/views/transactions/index.blade.php
index 729a7d2263..f96f23b171 100644
--- a/app/views/transactions/list.blade.php
+++ b/app/views/transactions/index.blade.php
@@ -7,7 +7,8 @@
{{{$subTitle}}}
-
+
+
@@ -29,14 +30,7 @@
@stop
@section('scripts')
-{{HTML::script('assets/javascript/typeahead/bootstrap3-typeahead.min.js')}}
-{{HTML::script('assets/javascript/datatables/jquery.dataTables.min.js')}}
-{{HTML::script('assets/javascript/datatables/dataTables.bootstrap.js')}}
{{HTML::script('assets/javascript/firefly/transactions.js')}}
-@stop
-@section('styles')
-{{HTML::style('assets/stylesheets/datatables/dataTables.bootstrap.css')}}
@stop
\ No newline at end of file
diff --git a/app/views/user/register.blade.php b/app/views/user/register.blade.php
index c067e57389..0b012cb628 100644
--- a/app/views/user/register.blade.php
+++ b/app/views/user/register.blade.php
@@ -11,7 +11,7 @@
Registering an account on Firefly requires an e-mail address.
All instructions will be sent to you.
- {{Form::open()}}
+ {{Form::open(['id' => 'register'])}}