mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fixed some tests.
This commit is contained in:
parent
fc0e76f431
commit
512b81ad93
@ -90,12 +90,8 @@ class HomeController extends BaseController
|
||||
public function sessionNext()
|
||||
{
|
||||
Navigation::next();
|
||||
$strPosition = strpos($_SERVER['HTTP_REFERER'], Config::get('app.url'));
|
||||
Log::debug('HTTP_REFERER is: ' . $_SERVER['HTTP_REFERER']);
|
||||
Log::debug('App.url = ' . Config::get('app.url'));
|
||||
Log::debug('strpos() = ' . Steam::boolString($strPosition));
|
||||
|
||||
if (isset($_SERVER['HTTP_REFERER']) && $strPosition === 0) {
|
||||
if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], Config::get('app.url')) === 0) {
|
||||
Log::debug('Redirect back');
|
||||
return Redirect::back();
|
||||
} else {
|
||||
@ -111,13 +107,8 @@ class HomeController extends BaseController
|
||||
public function sessionPrev()
|
||||
{
|
||||
Navigation::prev();
|
||||
$strPosition = strpos($_SERVER['HTTP_REFERER'], Config::get('app.url'));
|
||||
Log::debug('HTTP_REFERER is: ' . $_SERVER['HTTP_REFERER']);
|
||||
Log::debug('App.url = ' . Config::get('app.url'));
|
||||
Log::debug('strpos() = ' . Steam::boolString($strPosition));
|
||||
|
||||
|
||||
if (isset($_SERVER['HTTP_REFERER']) && $strPosition === 0) {
|
||||
if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], Config::get('app.url')) === 0) {
|
||||
Log::debug('Redirect back');
|
||||
return Redirect::back();
|
||||
} else {
|
||||
|
@ -68,7 +68,8 @@ class TransactionJournal implements TransactionJournalInterface, CUDInterface, C
|
||||
'transaction_type_id' => $data['transaction_type_id'],
|
||||
'transaction_currency_id' => $data['transaction_currency_id'],
|
||||
'user_id' => $this->getUser()->id,
|
||||
'description' => $data['description'], 'date' => $data['date'], 'completed' => 0]
|
||||
'description' => $data['description'],
|
||||
'date' => $data['date'], 'completed' => 0]
|
||||
);
|
||||
$journal->save();
|
||||
|
||||
@ -161,6 +162,9 @@ class TransactionJournal implements TransactionJournalInterface, CUDInterface, C
|
||||
if (!isset($model['what'])) {
|
||||
$errors->add('description', 'Internal error: need to know type of transaction!');
|
||||
}
|
||||
if (strlen($model['description']) == 0) {
|
||||
$errors->add('description', 'The description field is required.');
|
||||
}
|
||||
$errors = $errors->merge($this->_validateAmount($model));
|
||||
$errors = $errors->merge($this->_validateBudget($model));
|
||||
$errors = $errors->merge($this->_validateAccount($model));
|
||||
@ -291,19 +295,6 @@ class TransactionJournal implements TransactionJournalInterface, CUDInterface, C
|
||||
return $typeRepository->findByWhat($type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $currency
|
||||
*
|
||||
* @return null|\TransactionCurrency
|
||||
*/
|
||||
public function getJournalCurrency($currency)
|
||||
{
|
||||
/** @var \FireflyIII\Database\TransactionCurrency\TransactionCurrency $currencyRepository */
|
||||
$currencyRepository = \App::make('FireflyIII\Database\TransactionCurrency\TransactionCurrency');
|
||||
|
||||
return $currencyRepository->findByCode($currency);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $currencyId
|
||||
*
|
||||
@ -563,6 +554,19 @@ class TransactionJournal implements TransactionJournalInterface, CUDInterface, C
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $currency
|
||||
*
|
||||
* @return null|\TransactionCurrency
|
||||
*/
|
||||
public function getJournalCurrency($currency)
|
||||
{
|
||||
/** @var \FireflyIII\Database\TransactionCurrency\TransactionCurrency $currencyRepository */
|
||||
$currencyRepository = \App::make('FireflyIII\Database\TransactionCurrency\TransactionCurrency');
|
||||
|
||||
return $currencyRepository->findByCode($currency);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $limit
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user