Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop

This commit is contained in:
James Cole 2019-09-22 22:10:44 +02:00
commit 45bd21ca84
11 changed files with 25 additions and 10 deletions

View File

@ -76,7 +76,7 @@ class AccountUpdateRequest extends Request
'opening_balance_date' => $this->date('opening_balance_date'), 'opening_balance_date' => $this->date('opening_balance_date'),
'cc_type' => $this->nullableString('credit_card_type'), 'cc_type' => $this->nullableString('credit_card_type'),
'cc_Monthly_payment_date' => $this->nullableString('monthly_payment_date'), 'cc_Monthly_payment_date' => $this->nullableString('monthly_payment_date'),
'notes' => $this->nullableString('notes'), 'notes' => $this->nullableNlString('notes'),
'interest' => $this->nullableString('interest'), 'interest' => $this->nullableString('interest'),
'interest_period' => $this->nullableString('interest_period'), 'interest_period' => $this->nullableString('interest_period'),
]; ];

View File

@ -56,7 +56,7 @@ class AttachmentStoreRequest extends Request
return [ return [
'filename' => $this->string('filename'), 'filename' => $this->string('filename'),
'title' => $this->string('title'), 'title' => $this->string('title'),
'notes' => $this->string('notes'), 'notes' => $this->nlString('notes'),
'model' => $this->string('model'), 'model' => $this->string('model'),
'model_id' => $this->integer('model_id'), 'model_id' => $this->integer('model_id'),
]; ];

View File

@ -51,7 +51,7 @@ class AttachmentUpdateRequest extends Request
return [ return [
'filename' => $this->string('filename'), 'filename' => $this->string('filename'),
'title' => $this->string('title'), 'title' => $this->string('title'),
'notes' => $this->string('notes'), 'notes' => $this->nlString('notes'),
'model' => $this->string('model'), 'model' => $this->string('model'),
'model_id' => $this->integer('model_id'), 'model_id' => $this->integer('model_id'),
]; ];

View File

@ -70,7 +70,7 @@ class BillRequest extends Request
'repeat_freq' => $this->string('repeat_freq'), 'repeat_freq' => $this->string('repeat_freq'),
'skip' => $this->integer('skip'), 'skip' => $this->integer('skip'),
'active' => $active, 'active' => $active,
'notes' => $this->string('notes'), 'notes' => $this->nlString('notes'),
]; ];
return $data; return $data;

View File

@ -62,7 +62,7 @@ class PiggyBankRequest extends Request
'current_amount' => $this->string('current_amount'), 'current_amount' => $this->string('current_amount'),
'startdate' => $this->date('start_date'), 'startdate' => $this->date('start_date'),
'targetdate' => $this->date('target_date'), 'targetdate' => $this->date('target_date'),
'notes' => $this->string('notes'), 'notes' => $this->nlString('notes'),
]; ];
} }

View File

@ -69,7 +69,7 @@ class RecurrenceUpdateRequest extends Request
'title' => $this->nullableString('title'), 'title' => $this->nullableString('title'),
'description' => $this->nullableString('description'), 'description' => $this->nullableString('description'),
'first_date' => $this->date('first_date'), 'first_date' => $this->date('first_date'),
'notes' => $this->nullableString('notes'), 'notes' => $this->nullableNlString('notes'),
'repeat_until' => $this->date('repeat_until'), 'repeat_until' => $this->date('repeat_until'),
'nr_of_repetitions' => $this->nullableInteger('nr_of_repetitions'), 'nr_of_repetitions' => $this->nullableInteger('nr_of_repetitions'),
'apply_rules' => $applyRules, 'apply_rules' => $applyRules,

View File

@ -65,7 +65,7 @@ class Request extends FireflyIIIRequest
'opening_balance_date' => $this->date('opening_balance_date'), 'opening_balance_date' => $this->date('opening_balance_date'),
'cc_type' => $this->string('credit_card_type'), 'cc_type' => $this->string('credit_card_type'),
'cc_Monthly_payment_date' => $this->string('monthly_payment_date'), 'cc_Monthly_payment_date' => $this->string('monthly_payment_date'),
'notes' => $this->string('notes'), 'notes' => $this->nlString('notes'),
'interest' => $this->string('interest'), 'interest' => $this->string('interest'),
'interest_period' => $this->string('interest_period'), 'interest_period' => $this->string('interest_period'),
]; ];

View File

@ -57,7 +57,7 @@ class TransactionLinkRequest extends Request
'link_type_name' => $this->string('link_type_name'), 'link_type_name' => $this->string('link_type_name'),
'inward_id' => $this->integer('inward_id'), 'inward_id' => $this->integer('inward_id'),
'outward_id' => $this->integer('outward_id'), 'outward_id' => $this->integer('outward_id'),
'notes' => $this->string('notes'), 'notes' => $this->nlString('notes'),
]; ];
} }

View File

@ -242,7 +242,7 @@ class TransactionStoreRequest extends Request
// some other interesting properties // some other interesting properties
'reconciled' => $this->convertBoolean((string)$object['reconciled']), 'reconciled' => $this->convertBoolean((string)$object['reconciled']),
'notes' => $this->stringFromValue($object['notes']), 'notes' => $this->nlStringFromValue($object['notes']),
'tags' => $this->arrayFromValue($object['tags']), 'tags' => $this->arrayFromValue($object['tags']),
// all custom fields: // all custom fields:

View File

@ -63,7 +63,7 @@ class AccountFormRequest extends Request
'opening_balance_date' => $this->date('opening_balance_date'), 'opening_balance_date' => $this->date('opening_balance_date'),
'cc_type' => $this->string('cc_type'), 'cc_type' => $this->string('cc_type'),
'cc_monthly_payment_date' => $this->string('cc_monthly_payment_date'), 'cc_monthly_payment_date' => $this->string('cc_monthly_payment_date'),
'notes' => $this->string('notes'), 'notes' => $this->nlString('notes'),
'interest' => $this->string('interest'), 'interest' => $this->string('interest'),
'interest_period' => $this->string('interest_period'), 'interest_period' => $this->string('interest_period'),
'include_net_worth' => '1', 'include_net_worth' => '1',

View File

@ -237,6 +237,21 @@ class Request extends FormRequest
} }
/**
* Return string value, but keep newlines, or NULL if empty.
*
* @param string $field
*
* @return string
*/
public function nullableNlString(string $field): string
{
if (!$this->has($field)) {
return null;
}
return app('steam')->nlCleanString((string)($this->get($field) ?? ''));
}
/** /**
* Parse and clean a string. * Parse and clean a string.
* *