diff --git a/src/Http/Controllers/CampaignController.php b/src/Http/Controllers/CampaignController.php index 26de1b0..88462be 100644 --- a/src/Http/Controllers/CampaignController.php +++ b/src/Http/Controllers/CampaignController.php @@ -85,6 +85,7 @@ public function show(Campaign $campaign) 'leads' => [ 'syncTags' => route('teamtnt.sales-management.leads.sync-tags', ':leadId'), 'leadData' => route('teamtnt.sales-management.lead.data', [$campaign, ':leadId']), + 'leadStageChange' => route('teamtnt.sales-management.lead.stage.change', [$campaign, ':leadId']), ], 'messages' => [ 'send' => route('teamtnt.sales-management.send.message', [$campaign, ':leadId']), diff --git a/src/Http/Controllers/LeadsController.php b/src/Http/Controllers/LeadsController.php index e879ca7..e2de8b0 100644 --- a/src/Http/Controllers/LeadsController.php +++ b/src/Http/Controllers/LeadsController.php @@ -60,4 +60,16 @@ public function getLeadData(Campaign $campaign, Lead $lead) ]); } + public function leadStageChange(Campaign $campaign, Lead $lead, Request $request) + { + if (!$lead) { + return response()->json(404); + } + + $lead->pipeline_stage_id = request('stage_id'); + $lead->save(); + + return response()->json(200); + } + } diff --git a/src/resources/js/components/Lead/LeadCampaign.vue b/src/resources/js/components/Lead/LeadCampaign.vue index 4142aa5..80a196c 100644 --- a/src/resources/js/components/Lead/LeadCampaign.vue +++ b/src/resources/js/components/Lead/LeadCampaign.vue @@ -40,7 +40,8 @@ const props = defineProps({ const data = reactive({ route: props.routes, - emails: props.emails + emails: props.emails, + stages: props.stages }); provide('data', data); diff --git a/src/resources/js/components/Lead/OffCanvas.vue b/src/resources/js/components/Lead/OffCanvas.vue index d490090..219eb72 100644 --- a/src/resources/js/components/Lead/OffCanvas.vue +++ b/src/resources/js/components/Lead/OffCanvas.vue @@ -145,6 +145,18 @@ +
+ + + {{ $t('Stages') }} + + +
+
@@ -252,6 +264,7 @@ import Notes from "../Notes/Notes.vue"; import Activities from "../Notes/Activities.vue"; import MultiSelectList from "../MultiSelectList/MultiSelectList.vue"; import SendEmailForm from "./SendEmailForm.vue"; +import RegularSelect from "../RegularSelect/RegularSelect.vue"; const props = defineProps({ modelValue: { diff --git a/src/resources/js/components/RegularSelect/RegularSelect.vue b/src/resources/js/components/RegularSelect/RegularSelect.vue new file mode 100644 index 0000000..d213627 --- /dev/null +++ b/src/resources/js/components/RegularSelect/RegularSelect.vue @@ -0,0 +1,75 @@ +
+ + +
+ + + diff --git a/src/resources/lang/de.json b/src/resources/lang/de.json index c1eb85f..67c9a30 100644 --- a/src/resources/lang/de.json +++ b/src/resources/lang/de.json @@ -44,5 +44,7 @@ "Message": "Nachricht", "Send Message": "Nachricht senden", "Leads": "Leads", - "Create New List": "Neue Liste erstellen" + "Create New List": "Neue Liste erstellen", + "Stages": "Stages", + "Lead moved to another stage!": "Lead in neue Stage verschoben!" } diff --git a/src/resources/views/campaign/show.blade.php b/src/resources/views/campaign/show.blade.php index 369d258..50c392b 100644 --- a/src/resources/views/campaign/show.blade.php +++ b/src/resources/views/campaign/show.blade.php @@ -37,7 +37,6 @@ @endcan
- name('lead.data'); + Route::post('/campaign/{campaign}/lead/{lead}/stage-change', [LeadsController::class, 'leadStageChange'])->name('lead.stage.change'); });