diff --git a/app/Models/Project.php b/app/Models/Project.php index ed5692dd3c..1c90ebab5d 100644 --- a/app/Models/Project.php +++ b/app/Models/Project.php @@ -25,6 +25,9 @@ class Project extends EntityModel protected $fillable = [ 'name', 'task_rate', + 'private_notes', + 'due_date', + 'budgeted_hours', ]; /** diff --git a/app/Ninja/Repositories/ProjectRepository.php b/app/Ninja/Repositories/ProjectRepository.php index 8aa704efca..d9119fa93e 100644 --- a/app/Ninja/Repositories/ProjectRepository.php +++ b/app/Ninja/Repositories/ProjectRepository.php @@ -5,6 +5,7 @@ namespace App\Ninja\Repositories; use App\Models\Project; use Auth; use DB; +use Utils; class ProjectRepository extends BaseRepository { @@ -71,6 +72,11 @@ class ProjectRepository extends BaseRepository } $project->fill($input); + + if (isset($input['due_date'])) { + $project->due_date = Utils::toSqlDate($input['due_date']); + } + $project->save(); return $project; diff --git a/database/migrations/2017_12_13_074024_add_remember_2fa_token.php b/database/migrations/2017_12_13_074024_add_remember_2fa_token.php index ec324a7671..1c241708e9 100644 --- a/database/migrations/2017_12_13_074024_add_remember_2fa_token.php +++ b/database/migrations/2017_12_13_074024_add_remember_2fa_token.php @@ -55,6 +55,12 @@ class AddRemember2faToken extends Migration Schema::table('invoice_items', function ($table) { $table->float('discount'); }); + + Schema::table('projects', function ($table) { + $table->date('due_date')->nullable(); + $table->text('private_notes')->nullable(); + $table->float('budgeted_hours'); + }); } /** @@ -90,5 +96,11 @@ class AddRemember2faToken extends Migration Schema::table('invoice_items', function ($table) { $table->dropColumn('discount'); }); + + Schema::table('projects', function ($table) { + $table->dropColumn('due_date'); + $table->dropColumn('private_notes'); + $table->dropColumn('budgeted_hours'); + }); } } diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index fdf2ca6c55..551a186431 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2623,6 +2623,7 @@ $LANG = array( 'convert_products' => 'Convert Products', 'convert_products_help' => 'Automatically convert product prices to the client\'s currency', 'improve_client_portal_link' => 'Set a subdomain to shorten the client portal link.', + 'budgeted_hours' => 'Budgeted Hours', ); diff --git a/resources/views/projects/edit.blade.php b/resources/views/projects/edit.blade.php index 75e6897c0a..aa436454e1 100644 --- a/resources/views/projects/edit.blade.php +++ b/resources/views/projects/edit.blade.php @@ -38,10 +38,19 @@ {!! Former::text('name') !!} + {!! Former::text('due_date') + ->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT, DEFAULT_DATE_PICKER_FORMAT)) + ->addGroupClass('due_date') + ->append('') !!} + + {!! Former::text('budgeted_hours')->type('number') !!} + {!! Former::text('task_rate') ->placeholder($project && $project->client->task_rate ? $project->client->present()->taskRate : $account->present()->taskRate) ->help('task_rate_help') !!} + {!! Former::textarea('private_notes')->rows(4) !!} + @@ -120,6 +129,8 @@ $('#task_rate').attr('placeholder', roundSignificant(rate, true)); }); + $('#due_date').datepicker('update', '{{ $project ? Utils::fromSqlDate($project->due_date) : '' }}'); + @if ($clientPublicId) $('#name').focus(); @else