Skip to content

Commit 0eafd14

Browse files
committed
Allow leads to be unallocated
1 parent 23d49bb commit 0eafd14

File tree

6 files changed

+6
-7
lines changed

6 files changed

+6
-7
lines changed

resources/lang/en/lang.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,4 +514,5 @@
514514
'create_and_add_another' => 'create & add another',
515515
'invoice_payment_instructions' => 'invoice payment instructions',
516516
'payment' => 'payment',
517+
'unallocated' => 'unallocated',
517518
];

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 ?? null }}</td>
58+
<td>{{ $lead->ownerUser->name ?? "Unallocated" }}</td>
5959
<td class="disable-link text-right">
6060
@hasdealsenabled
6161
@can('edit crm leads')

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

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
@include('laravel-crm::partials.form.select',[
6161
'name' => 'user_owner_id',
6262
'label' => ucfirst(__('laravel-crm::lang.owner')),
63-
'options' => \VentureDrake\LaravelCrm\Http\Helpers\SelectOptions\users(false),
64-
'value' => old('user_owner_id', $lead->user_owner_id ?? auth()->user()->id),
63+
'options' => ['' => ucfirst(__('laravel-crm::lang.unallocated'))] + \VentureDrake\LaravelCrm\Http\Helpers\SelectOptions\users(false),
64+
'value' => old('user_owner_id', (isset($lead)) ? $lead->user_owner_id ?? '' : auth()->user()->id),
6565
])
6666

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

src/Http/Requests/StoreLeadRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ public function rules()
2929
'organisation_name' => 'required_without_all:person_name,person_id|max:255',
3030
'organisation_id' => 'required_without_all:person_name,person_id,organisation_name|max:255',
3131
'title' => 'required|max:255',
32-
'amount' => 'nullable|numeric',
33-
'user_owner_id' => 'required'
32+
'amount' => 'nullable|numeric'
3433
];
3534
}
3635

src/Http/Requests/UpdateLeadRequest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ public function rules()
3030
'organisation_id' => 'required_without_all:person_name,person_id,organisation_name|max:255',
3131
'title' => 'required|max:255',
3232
'amount' => 'nullable|numeric',
33-
'user_owner_id' => 'required',
3433
];
3534
}
3635

0 commit comments

Comments
 (0)