From 6876edc5102437fad60641074c64b67c8a73820a Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 19 Mar 2014 20:54:27 +0200 Subject: [PATCH] Bug fixes --- app/controllers/HomeController.php | 2 +- app/database/seeds/UserTableSeeder.php | 14 ------ app/routes.php | 63 ++++++++++++-------------- app/views/master.blade.php | 6 --- 4 files changed, 30 insertions(+), 55 deletions(-) diff --git a/app/controllers/HomeController.php b/app/controllers/HomeController.php index 459ad6bd2ef8..3b4776c1f389 100755 --- a/app/controllers/HomeController.php +++ b/app/controllers/HomeController.php @@ -46,7 +46,7 @@ class HomeController extends BaseController { 'text' => $message ]; - $this->mailer->sendTo('contact@invoiceninja.com', 'contact@invoiceninja.com', 'Invoice Ninja Feedback', 'contact', $data); + $this->mailer->sendTo(CONTACT_EMAIL, CONTACT_EMAIL, 'Invoice Ninja Feedback', 'contact', $data); Session::flash('message', 'Successfully sent message'); return Redirect::to('/contact'); diff --git a/app/database/seeds/UserTableSeeder.php b/app/database/seeds/UserTableSeeder.php index 3da62963161b..4250450755d8 100755 --- a/app/database/seeds/UserTableSeeder.php +++ b/app/database/seeds/UserTableSeeder.php @@ -5,21 +5,7 @@ class UserTableSeeder extends Seeder public function run() { - //DB::table('users')->delete(); - /* - $account = Account::create(array( - 'name' => 'Acme Inc', - )); - - $user = User::create(array( - 'account_id' => $account->id, - 'first_name' => 'Hillel', - 'last_name' => 'Coren', - 'email' => 'hillelcoren@gmail.com', - 'password' => Hash::make('1234'), - )); - */ } } \ No newline at end of file diff --git a/app/routes.php b/app/routes.php index 743be977d651..6096b7619c8e 100755 --- a/app/routes.php +++ b/app/routes.php @@ -22,37 +22,6 @@ //dd(gethostname()); //Log::error('test'); -/* -Event::listen('illuminate.query', function($query, $bindings, $time, $name) -{ - $data = compact('bindings', 'time', 'name'); - - // Format binding data for sql insertion - foreach ($bindings as $i => $binding) - { - if ($binding instanceof \DateTime) - { - $bindings[$i] = $binding->format('\'Y-m-d H:i:s\''); - } - else if (is_string($binding)) - { - $bindings[$i] = "'$binding'"; - } - } - - // Insert bindings into query - $query = str_replace(array('%', '?'), array('%%', '%s'), $query); - $query = vsprintf($query, $bindings); - - Log::info($query, $data); -}); -*/ - -/* -Route::get('/send_emails', function() { - Artisan::call('ninja:send-invoices'); -}); -*/ Route::get('/', 'HomeController@showWelcome'); Route::get('/rocksteady', 'HomeController@showWelcome'); @@ -257,7 +226,7 @@ define('DEFAULT_CURRENCY', 1); // US Dollar define('DEFAULT_DATE_FORMAT', 'M j, Y'); define('DEFAULT_DATE_PICKER_FORMAT', 'M d, yyyy'); define('DEFAULT_DATETIME_FORMAT', 'F j, Y, g:i a'); -define('DEFAULT_QUERY_CACHE', 120); +define('DEFAULT_QUERY_CACHE', 120); // minutes define('GATEWAY_PAYPAL_EXPRESS', 17); @@ -267,7 +236,6 @@ if (Auth::check() && !Session::has(SESSION_TIMEZONE)) Event::fire('user.refresh'); } - Validator::extend('positive', function($attribute, $value, $parameters) { return Utils::parseFloat($value) > 0; @@ -282,4 +250,31 @@ Validator::extend('has_credit', function($attribute, $value, $parameters) $credit = $client->getTotalCredit(); return $credit >= $amount; -}); \ No newline at end of file +}); + + +/* +Event::listen('illuminate.query', function($query, $bindings, $time, $name) +{ + $data = compact('bindings', 'time', 'name'); + + // Format binding data for sql insertion + foreach ($bindings as $i => $binding) + { + if ($binding instanceof \DateTime) + { + $bindings[$i] = $binding->format('\'Y-m-d H:i:s\''); + } + else if (is_string($binding)) + { + $bindings[$i] = "'$binding'"; + } + } + + // Insert bindings into query + $query = str_replace(array('%', '?'), array('%%', '%s'), $query); + $query = vsprintf($query, $bindings); + + Log::info($query, $data); +}); +*/ \ No newline at end of file diff --git a/app/views/master.blade.php b/app/views/master.blade.php index 4bff66ac0842..34e4023f9e3f 100755 --- a/app/views/master.blade.php +++ b/app/views/master.blade.php @@ -55,12 +55,6 @@ ga('create', 'UA-46031341-1'); ga('send', 'pageview'); - @else - @endif @yield('body')