Handle project w/o a client set

This commit is contained in:
Hillel Coren 2017-03-02 18:23:07 +02:00
parent 59b107fc66
commit 595a8a5aed

View File

@ -29,7 +29,7 @@
@if ($project)
{!! Former::plaintext('client_name')
->value($project->client->getDisplayName()) !!}
->value($project->client ? $project->client->getDisplayName() : '') !!}
@else
{!! Former::select('client_id')
->addOption('', '')
@ -52,7 +52,7 @@
{!! Button::success(trans('texts.save'))->submit()->large()->appendIcon(Icon::create('floppy-disk')) !!}
@if ($project && Auth::user()->can('create', ENTITY_TASK))
{!! Button::primary(trans('texts.new_task'))->large()
->asLinkTo(url("/tasks/create/{$project->client->public_id}/{$project->public_id}"))
->asLinkTo(url('/tasks/create/' . ($project->client ? $project->client->public_id : '0'). '/' . $project->public_id))
->appendIcon(Icon::create('plus-sign')) !!}
@endif
</center>