Mails previews, Lead Passolution, Lead Country Files, LeadParticipant
This commit is contained in:
parent
5e3bd3a1ba
commit
ae70577289
28 changed files with 596 additions and 97 deletions
|
|
@ -7,6 +7,7 @@ use Request;
|
|||
use App\Models\Lead;
|
||||
use App\Models\LeadFile;
|
||||
use App\Models\LeadNotice;
|
||||
use App\Models\LeadParticipant;
|
||||
use App\Models\StatusHistory;
|
||||
use App\Repositories\LeadRepository;
|
||||
use App\Repositories\CustomerRepository;
|
||||
|
|
@ -42,11 +43,13 @@ class LeadController extends Controller
|
|||
|
||||
}else{
|
||||
$lead = Lead::findOrFail($id);
|
||||
$lead->getPassolutionPDF(true);
|
||||
$id = $lead->id;
|
||||
}
|
||||
$data = [
|
||||
'lead' => $lead,
|
||||
'id' => $id,
|
||||
'show_modal_quill_preview' => true,
|
||||
];
|
||||
return view('lead.detail', $data);
|
||||
|
||||
|
|
@ -84,11 +87,34 @@ class LeadController extends Controller
|
|||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('lead_detail', [$lead->id])."#collapseLeadNotice");
|
||||
}
|
||||
if($data['action'] === 'update_lead_participant'){
|
||||
$lead = $this->leadRepo->updateLeadParticipant($id, $data);
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('lead_detail', [$lead->id])."#collapseBookingParticipant");
|
||||
}
|
||||
|
||||
|
||||
return back();
|
||||
}
|
||||
|
||||
public function action($action, $id=false){
|
||||
|
||||
if(!$lead = Lead::find($id)){
|
||||
abort(404);
|
||||
}
|
||||
if($action === 'lead_participant_add'){
|
||||
LeadParticipant::create([
|
||||
'lead_id' => $lead->id,
|
||||
'nationality_id' => 1,
|
||||
'participant_salutation_id' => 1,
|
||||
|
||||
]);
|
||||
\Session()->flash('alert-success', __('Neuen Teilnehmer hinzugefügt'));
|
||||
return redirect(route('lead_detail', [$lead->id])."#collapseLeadParticipant");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function getAjaxRequests(){
|
||||
|
||||
$data = Request::all();
|
||||
|
|
@ -142,13 +168,19 @@ class LeadController extends Controller
|
|||
$lead->delete();
|
||||
\Session()->flash('alert-success', __('Anfrage gelöscht'));
|
||||
}
|
||||
|
||||
if($del === 'passolution_file'){
|
||||
$lead = Lead::findOrFail($id);
|
||||
$lead->resyncPassolutionPDF();
|
||||
\Session()->flash('alert-success', 'Passolution erneuert');
|
||||
return redirect(route('lead_detail', [$lead->id]).'#collapseLeadFiles');
|
||||
|
||||
}
|
||||
if($del === 'lead_notice'){
|
||||
$leadNotice = LeadNotice::findOrFail($id);
|
||||
$lead = $leadNotice->lead;
|
||||
$leadNotice->delete();
|
||||
\Session()->flash('alert-success', 'Notiz gelöscht');
|
||||
return redirect(route('lead_detail', [$lead->id]));
|
||||
return redirect(route('lead_detail', [$lead->id]).'#collapseLeadNotice');
|
||||
}
|
||||
|
||||
if($del === 'lead_files'){
|
||||
|
|
@ -159,7 +191,7 @@ class LeadController extends Controller
|
|||
$fileRepo->delete();
|
||||
$leadFile->delete();
|
||||
\Session()->flash('alert-success', 'Datei gelöscht');
|
||||
return redirect(route('lead_detail', [$lead->id]));
|
||||
return redirect(route('lead_detail', [$lead->id]).'#collapseLeadFiles');
|
||||
}
|
||||
return redirect(route('leads'));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue