Skip to content

Commit f1efe06

Browse files
committed
Unallocated owner for models
1 parent 0eafd14 commit f1efe06

37 files changed

+43
-49
lines changed

resources/views/clients/partials/card-index.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
'labels' => $client->labels,
3838
'limit' => 3
3939
])</td>
40-
<td>{{ $client->ownerUser->name ?? null }}</td>
40+
<td>{{ $client->ownerUser->name ?? "Unallocated" }}</td>
4141
<td class="disable-link text-right">
4242
@hasleadsenabled
4343
@can('create crm leads')

resources/views/clients/partials/card-show.blade.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@
6464
<hr />
6565
<dl class="row">
6666
<dt class="col-sm-3 text-right">{{ ucfirst(__('laravel-crm::lang.name')) }}</dt>
67-
<dd class="col-sm-9"><a href="{{ route('laravel-crm.users.show', $client->ownerUser) }}">{{ $client->ownerUser->name }}</a></dd>
67+
<dd class="col-sm-9">
68+
@if($client->ownerUser)<a href="{{ route('laravel-crm.users.show', $client->ownerUser) }}">{{ $client->ownerUser->name ?? null }}</a> @else {{ ucfirst(__('laravel-crm::lang.unallocated')) }} @endif
69+
</dd>
6870
</dl>
6971
@livewire('related-contact-people',[
7072
'model' => $client

resources/views/clients/partials/fields.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
@include('laravel-crm::partials.form.select',[
1616
'name' => 'user_owner_id',
1717
'label' => ucfirst(__('laravel-crm::lang.owner')),
18-
'options' => \VentureDrake\LaravelCrm\Http\Helpers\SelectOptions\users(false),
19-
'value' => old('user_owner_id', $client->user_owner_id ?? auth()->user()->id),
18+
'options' => ['' => ucfirst(__('laravel-crm::lang.unallocated'))] + \VentureDrake\LaravelCrm\Http\Helpers\SelectOptions\users(false),
19+
'value' => old('user_owner_id', (isset($client)) ? $client->user_owner_id ?? '' : auth()->user()->id),
2020
'required' => true
2121
])
2222
@include('laravel-crm::fields.partials.model', ['model' => $client ?? new \VentureDrake\LaravelCrm\Models\Client()])

resources/views/deals/partials/card-index.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
<td>{{ $deal->organisation->name ?? null }}</td>
5757
<td>{{ $deal->person->name ?? null }}</td>
5858
<td>{{ ($deal->expected_close) ? $deal->expected_close->format($dateFormat) : null }}</td>
59-
<td>{{ $deal->ownerUser->name ?? null }}</td>
59+
<td>{{ $deal->ownerUser->name ?? ucfirst(__('laravel-crm::lang.unallocated')) }}</td>
6060
<td class="disable-link text-right">
6161
@can('edit crm deals')
6262
@if(!$deal->closed_at)

resources/views/deals/partials/card-show.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
])</p>
4848
<p><span class="fa fa-dollar" aria-hidden="true"></span> {{ money($deal->amount, $deal->currency) }}</p>
4949
<p><span class="fa fa-info" aria-hidden="true"></span> {{ $deal->description }}</p>
50-
<p><span class="fa fa-user-circle" aria-hidden="true"></span> <a href="{{ route('laravel-crm.users.show', $deal->ownerUser) }}">{{ $deal->ownerUser->name ?? null }}</a></p>
50+
<p><span class="fa fa-user-circle" aria-hidden="true"></span> @if($deal->ownerUser)<a href="{{ route('laravel-crm.users.show', $deal->ownerUser) }}">{{ $deal->ownerUser->name ?? null }}</a> @else {{ ucfirst(__('laravel-crm::lang.unallocated')) }} @endif</p>
5151
<h6 class="mt-4 text-uppercase">{{ ucfirst(__('laravel-crm::lang.client')) }}</h6>
5252
<hr />
5353
<p><span class="fa fa-address-card" aria-hidden="true"></span> @if($deal->client)<a href="{{ route('laravel-crm.clients.show',$deal->client) }}">{{ $deal->client->name }}</a>@endif </p>

resources/views/deals/partials/fields.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171
@include('laravel-crm::partials.form.select',[
7272
'name' => 'user_owner_id',
7373
'label' => ucfirst(__('laravel-crm::lang.owner')),
74-
'options' => \VentureDrake\LaravelCrm\Http\Helpers\SelectOptions\users(false),
75-
'value' => old('user_owner_id', $deal->user_owner_id ?? auth()->user()->id),
74+
'options' => ['' => ucfirst(__('laravel-crm::lang.unallocated'))] + \VentureDrake\LaravelCrm\Http\Helpers\SelectOptions\users(false),
75+
'value' => old('user_owner_id', (isset($deal)) ? $deal->user_owner_id ?? '' : auth()->user()->id),
7676
])
7777

7878
@include('laravel-crm::fields.partials.model', ['model' => $deal ?? new \VentureDrake\LaravelCrm\Models\Deal()])

resources/views/deliveries/partials/card-index.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
<td>
8888
{{ $delivery->delivered_on ?? null }}
8989
</td>
90-
<td>{{ $delivery->ownerUser->name ?? null }}</td>
90+
<td>{{ $delivery->ownerUser->name ?? ucfirst(__('laravel-crm::lang.unallocated')) }}</td>
9191
<td class="disable-link text-right">
9292
@can('view crm deliveries')
9393
<a class="btn btn-outline-secondary btn-sm" href="{{ route('laravel-crm.deliveries.download', $delivery) }}"><span class="fa fa-download" aria-hidden="true"></span></a>

resources/views/leads/partials/card-index.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<td>{{ $lead->organisation->name ?? null}}</td>
5656
<td>{{ $lead->person->name ?? null }}</td>
5757
<td>{{ $lead->pipelineStage->name ?? null }}</td>
58-
<td>{{ $lead->ownerUser->name ?? "Unallocated" }}</td>
58+
<td>{{ $lead->ownerUser->name ?? ucfirst(__('laravel-crm::lang.unallocated')) }}</td>
5959
<td class="disable-link text-right">
6060
@hasdealsenabled
6161
@can('edit crm leads')

resources/views/orders/partials/card-index.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
{{ money($order->total, $order->currency) }}
107107
@endif
108108
</td>
109-
<td>{{ $order->ownerUser->name ?? null }}</td>
109+
<td>{{ $order->ownerUser->name ?? ucfirst(__('laravel-crm::lang.unallocated')) }}</td>
110110
<td class="disable-link text-right">
111111
@can('edit crm orders')
112112
@if($subTotalError || $taxError || $totalError)

resources/views/orders/partials/card-show.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
'labels' => $order->labels
9090
])</dd>
9191
<dt class="col-sm-4 text-right">Owner</dt>
92-
<dd class="col-sm-8">{{ $order->ownerUser->name ?? null }}</dd>
92+
<dd class="col-sm-8">@if($order->ownerUser)<a href="{{ route('laravel-crm.users.show', $order->ownerUser) }}">{{ $order->ownerUser->name ?? null }}</a> @else {{ ucfirst(__('laravel-crm::lang.unallocated')) }} @endif</dd>
9393
</dl>
9494
<h6 class="mt-4 text-uppercase">{{ ucfirst(__('laravel-crm::lang.client')) }}</h6>
9595
<hr />

0 commit comments

Comments
 (0)