From 19e95c854c343406ba2b75c7dcfc1f5b9edb56fa Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 24 Dec 2013 01:22:16 -0500 Subject: [PATCH] bug fixes --- app/controllers/ClientController.php | 2 +- ...11_05_180133_confide_setup_users_table.php | 2 +- app/libraries/utils.php | 3 + app/routes.php | 6 +- app/views/header.blade.php | 60 +++++++++++-------- app/views/invoices/edit.blade.php | 27 +++++---- app/views/splash.blade.php | 2 +- bootstrap/start.php | 2 +- .../vendor/jquery/jquery.min.js | 2 + 9 files changed, 62 insertions(+), 44 deletions(-) create mode 100755 public/packages/barryvdh/laravel-debugbar/vendor/jquery/jquery.min.js diff --git a/app/controllers/ClientController.php b/app/controllers/ClientController.php index 4c19090755..ca59143bad 100755 --- a/app/controllers/ClientController.php +++ b/app/controllers/ClientController.php @@ -47,7 +47,7 @@ class ClientController extends \BaseController { ->addColumn('checkbox', function($model) { return ''; }) ->addColumn('name', function($model) { return link_to('clients/' . $model->public_id, $model->name); }) ->addColumn('first_name', function($model) { return $model->first_name . ' ' . $model->last_name; }) - ->addColumn('created_at', function($model) { return Utils::timestampToDateString($model->created_at); }) + ->addColumn('created_at', function($model) { return Utils::timestampToDateString(strtotime($model->created_at)); }) ->addColumn('email', function($model) { return $model->email ? HTML::mailto($model->email, $model->email) : ''; }) ->addColumn('work_phone', function($model) { return Utils::formatPhoneNumber($model->work_phone); }) ->addColumn('last_login', function($model) { return Utils::timestampToDateString($model->last_login); }) diff --git a/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php b/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php index 568d333649..fbb4d3a806 100755 --- a/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php +++ b/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php @@ -194,7 +194,7 @@ class ConfideSetupUsersTable extends Migration { $t->text('notes'); $t->decimal('balance', 10, 2); $t->decimal('paid_to_date', 10, 2); - $t->timestamp('last_login'); + $t->timestamp('last_login')->nullable(); $t->string('website'); $t->unsignedInteger('client_industry_id')->nullable(); $t->unsignedInteger('client_size_id')->nullable(); diff --git a/app/libraries/utils.php b/app/libraries/utils.php index a6a922a002..55b0ae9071 100755 --- a/app/libraries/utils.php +++ b/app/libraries/utils.php @@ -72,6 +72,9 @@ class Utils public static function timestampToString($timestamp, $timezone = false, $format) { + if (!$timestamp) { + return ''; + } $date = Carbon::createFromTimeStamp($timestamp); if ($timezone) { $date->tz = $timezone; diff --git a/app/routes.php b/app/routes.php index d401b701b6..767d28cc15 100755 --- a/app/routes.php +++ b/app/routes.php @@ -15,9 +15,11 @@ //dd(Client::getPrivateId(1)); //dd(new DateTime()); //Event::fire('user.signup'); +//dd(App::environment()); -include(app_path().'/libraries/utils.php'); // TODO_FIX -include(app_path().'/handlers/UserEventHandler.php'); // TODO_FIX + +include_once(app_path().'/libraries/utils.php'); // TODO_FIX +include_once(app_path().'/handlers/UserEventHandler.php'); // TODO_FIX Route::get('/send_emails', function() { Artisan::call('ninja:send-invoices'); diff --git a/app/views/header.blade.php b/app/views/header.blade.php index 196d1672fe..eb0b428871 100755 --- a/app/views/header.blade.php +++ b/app/views/header.blade.php @@ -39,10 +39,12 @@ } @endif + /* body > div.container { min-height: 600px; } - + */ + label.checkbox, label.control-label { font-weight: normal !important; @@ -230,7 +232,33 @@

Invoice Ninja -
+ +
+ +

+

+ -

-

diff --git a/app/views/invoices/edit.blade.php b/app/views/invoices/edit.blade.php index 81232fba22..8077fe4cb0 100755 --- a/app/views/invoices/edit.blade.php +++ b/app/views/invoices/edit.blade.php @@ -17,7 +17,7 @@ )); }}
-
+
{{ Former::select('client')->addOption('', '')->fromQuery($clients, 'name', 'public_id')->data_bind("dropdown: client") ->addGroupClass('client_select closer-row') }} @@ -37,23 +37,12 @@
- {{ Former::text('discount')->data_bind("value: discount, valueUpdate: 'afterkeydown'") }} {{ Former::textarea('terms')->data_bind("value: wrapped_terms, valueUpdate: 'afterkeydown'") }}
-
- {{ Former::checkbox('recurring')->text('Enable | Learn more')->data_bind("checked: is_recurring") - ->inlineHelp($invoice && $invoice->last_sent_date ? 'Last invoice sent ' . Utils::timestampToDateString($invoice->last_sent_date) : '') }} -
- @if ($invoice && $invoice->recurring_invoice_id) -
- Created by a {{ link_to('/invoices/'.$invoice->recurring_invoice_id, 'recurring invoice') }} -
- @endif
{{ Former::text('invoice_number')->label('Invoice #')->data_bind("value: invoice_number, valueUpdate: 'afterkeydown'") }} - {{ Former::text('po_number')->label('PO number')->data_bind("value: po_number, valueUpdate: 'afterkeydown'") }} {{ Former::text('invoice_date')->data_bind("value: invoice_date, valueUpdate: 'afterkeydown'") }} {{ Former::text('due_date')->data_bind("value: due_date, valueUpdate: 'afterkeydown'") }} @@ -64,8 +53,22 @@ {{ Former::text('start_date')->data_bind("value: start_date, valueUpdate: 'afterkeydown'") }} {{ Former::text('end_date')->data_bind("value: end_date, valueUpdate: 'afterkeydown'") }}
+
+ {{ Former::checkbox('recurring')->text('Enable | Learn more')->data_bind("checked: is_recurring") + ->inlineHelp($invoice && $invoice->last_sent_date ? 'Last invoice sent ' . Utils::timestampToDateString($invoice->last_sent_date) : '') }} +
+ @if ($invoice && $invoice->recurring_invoice_id) +
+ Created by a {{ link_to('/invoices/'.$invoice->recurring_invoice_id, 'recurring invoice') }} +
+ @endif
+ +
+ {{ Former::text('po_number')->label('PO number')->data_bind("value: po_number, valueUpdate: 'afterkeydown'") }} + {{ Former::text('discount')->data_bind("value: discount, valueUpdate: 'afterkeydown'") }} +

 

diff --git a/app/views/splash.blade.php b/app/views/splash.blade.php index 735630f856..cef4436205 100755 --- a/app/views/splash.blade.php +++ b/app/views/splash.blade.php @@ -9,7 +9,7 @@ - Invoice Ninja +