Mails previews, Lead Passolution, Lead Country Files, LeadParticipant

This commit is contained in:
Kevin Adametz 2021-09-17 14:32:51 +02:00
parent 5e3bd3a1ba
commit ae70577289
28 changed files with 596 additions and 97 deletions

View file

@ -52,7 +52,7 @@ class BookingController extends Controller
$data = [
'booking' => $booking,
'id' => $id,
'show_modal_quill_preview' => true,
];
return view('booking.detail', $data);
@ -117,7 +117,6 @@ class BookingController extends Controller
return redirect(route('booking_detail', [$booking->id])."#collapseBookingProvider");
}
if($data['action'] === 'update_booking_participant'){
$booking = $this->bookingRepo->updateBookingParticipant($id, $data);
\Session()->flash('alert-save', '1');
@ -366,7 +365,7 @@ class BookingController extends Controller
if($del === 'booking') {
//$model = Booking::findOrFail($id);
//$model->delete();
\Session()->flash('alert-success', __('Buchung gelöscht sowie die Reservierung im Sterntrous Kalender'));
\Session()->flash('alert-success', __('Löschen noch nicht programmiert'));
}
if($del === 'booking_file'){
$booking_file = BookingFile::findOrFail($id);

View file

@ -2,20 +2,21 @@
namespace App\Http\Controllers;
use Carbon;
use Request;
use Response;
use App\Services\Util;
use App\Models\EmailTemplate;
use App\Services\Placeholder;
use App\Models\CustomerFewoFile;
use App\Models\CustomerFewoMail;
use App\Models\EmailTemplate;
use Illuminate\Support\Facades\URL;
use App\Models\TravelUserBookingFewo;
use App\Models\TravelUserBookingFile;
use Illuminate\Database\Eloquent\Collection;
use App\Repositories\BookingFewoFileRepository;
use App\Repositories\CustomerFewoFileRepository;
use App\Repositories\CustomerFewoMailRepository;
use App\Services\Util;
use Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Facades\URL;
use Request;
use Response;
class CustomerFewoMailController extends Controller
{
@ -198,7 +199,13 @@ class CustomerFewoMailController extends Controller
$data = Request::all();
$ret = "";
$status = false;
if(Request::ajax()){
if(Request::ajax() && isset($data['action'])){
if($data['action'] === 'load_preview_mail'){
$booking_fewo = TravelUserBookingFewo::findOrFail($data['booking_fewo_id']);
$ret = Placeholder::replaceBookingFewo($booking_fewo, $data['content']);
$data['subject'] = Placeholder::replaceBookingFewo($booking_fewo, $data['subject']);
$status = 'success';
}
if($data['action'] === 'toggle_important'){
$customer_mail = CustomerFewoMail::find($data['id']);
$customer_mail->important = ($customer_mail->important ? false : true);

View file

@ -2,20 +2,22 @@
namespace App\Http\Controllers;
use Carbon;
use Request;
use Response;
use App\Services\Util;
use App\Models\Booking;
use App\Models\Customer;
use App\Models\CustomerFewoMail;
use App\Models\CustomerFile;
use App\Models\CustomerMail;
use App\Models\EmailTemplate;
use App\Repositories\CustomerFewoMailRepository;
use App\Repositories\CustomerMailRepository;
use App\Repositories\CustomerFileRepository;
use App\Services\Util;
use Carbon;
use Illuminate\Database\Eloquent\Collection;
use App\Services\Placeholder;
use App\Models\CustomerFewoMail;
use Illuminate\Support\Facades\URL;
use Request;
use Response;
use App\Repositories\CustomerFileRepository;
use App\Repositories\CustomerMailRepository;
use Illuminate\Database\Eloquent\Collection;
use App\Repositories\CustomerFewoMailRepository;
class CustomerMailController extends Controller
{
@ -216,7 +218,13 @@ class CustomerMailController extends Controller
$data = Request::all();
$ret = "";
$status = false;
if(Request::ajax()){
if(Request::ajax() && isset($data['action'])){
if($data['action'] === 'load_preview_mail'){
$booking = Booking::findOrFail($data['booking_id']);
$ret = Placeholder::replaceBooking($booking, $data['content']);
$data['subject'] = Placeholder::replaceBooking($booking, $data['subject']);
$status = 'success';
}
if($data['action'] === 'toggle_important'){
$customer_mail = CustomerMail::find($data['id']);
$customer_mail->important = ($customer_mail->important ? false : true);

View file

@ -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'));
}

View file

@ -11,6 +11,7 @@ use App\Models\LeadFile;
use App\Models\LeadMail;
use App\Models\EmailTemplate;
use App\Services\Placeholder;
use Illuminate\Support\Facades\URL;
use App\Models\TravelUserBookingFewo;
use App\Repositories\LeadFileRepository;
@ -53,8 +54,6 @@ class LeadMailController extends Controller
\Session()->flash('alert-success', __('E-Mail weitergeleitet'));
}
return back();
}
@ -68,7 +67,6 @@ class LeadMailController extends Controller
return back();
}
public function loadModal(){
$data = Request::all();
$ret = "";
@ -184,7 +182,13 @@ class LeadMailController extends Controller
$data = Request::all();
$ret = "";
$status = false;
if(Request::ajax()){
if(Request::ajax() && isset($data['action'])){
if($data['action'] === 'load_preview_mail'){
$lead = Lead::findOrFail($data['lead_id']);
$ret = Placeholder::replaceLead($lead, $data['content']);
$data['subject'] = Placeholder::replaceLead($lead, $data['subject']);
$status = 'success';
}
if($data['action'] === 'toggle_important'){
$lead_mail = LeadMail::find($data['id']);
$lead_mail->important = ($lead_mail->important ? false : true);

View file

@ -76,6 +76,7 @@ class TravelUserBookingFewoController extends Controller
'max_adults' => $max_adults,
'max_children' => $max_children,
'id' => $id,
'show_modal_quill_preview' => true,
];
return view('travel.user.booking.detail', $data);
}
@ -258,7 +259,7 @@ class TravelUserBookingFewoController extends Controller
$travel_user_booking_fewo = $booking_fewo_notice->travel_user_booking_fewo;
$booking_fewo_notice->delete();
\Session()->flash('alert-success', 'Notiz gelöscht');
return redirect(route('travel_user_booking_fewo_detail', [$travel_user_booking_fewo->id]));
return redirect(route('travel_user_booking_fewo_detail', [$travel_user_booking_fewo->id])."#collapseBookingNotice");
}
if($del === 'booking_fewo_files'){
@ -269,7 +270,7 @@ class TravelUserBookingFewoController extends Controller
$fileRepo->delete();
$booking_fewo_file->delete();
\Session()->flash('alert-success', 'Datei gelöscht');
return redirect(route('travel_user_booking_fewo_detail', [$travel_user_booking_fewo->id]));
return redirect(route('travel_user_booking_fewo_detail', [$travel_user_booking_fewo->id]).'#collapseBookingFiles');
}
return redirect(route('travel_user_booking_fewos'));
}

View file

@ -6,10 +6,11 @@
namespace App\Models;
use App\Models\Lead as ModelsLead;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use App\Services\Passolution;
use App\Models\Lead as ModelsLead;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Collection;
/**
* Class Lead
@ -153,7 +154,8 @@ class Lead extends Model
'participant_birthdate',
'participant_salutation_id'
];
protected $passolutionPDFs = [];
public static $lead_mail_dirs = [
11 => ['name' => 'Entwürfe', 'icon'=>'ion-md-create'],
12 => ['name' => 'Papierkorb', 'icon'=>'ion-md-trash'],
@ -340,4 +342,45 @@ class Lead extends Model
}
return $this->lead_mails->where('dir', $dir)->count();
}
public function getPassolutionPDF($create = false, $resync = false){
$nats = [];
if(count($this->passolutionPDFs)){
return $this->passolutionPDFs;
}
if(!$this->travel_country){
return $this->passolutionPDFs;
}
$destco = $this->travel_country->destco;
//default no travel_nationality
$nats['de'] = 'de';
if($this->lead_participants->count()){
foreach ($this->lead_participants as $participant){
if($participant->travel_nationality){
$nats[$participant->travel_nationality->nat] = $participant->travel_nationality->nat;
}
}
}
if(empty($nats)){
$nats['de'] = 'de';
}
foreach ($nats as $nat){
$data = [
'nat' => $nat,
'destco' => $destco,
];
$passolution = new Passolution($data);
$this->passolutionPDFs[] = $passolution->findOrCreatePDF($create, $resync);
}
return $this->passolutionPDFs;
}
public function resyncPassolutionPDF(){
return $this->getPassolutionPDF(true, true);
}
}

View file

@ -53,7 +53,9 @@ class LeadParticipant extends Model
'participant_name',
'participant_firstname',
'participant_birthdate',
'participant_salutation_id'
'participant_salutation_id',
'participant_child',
'nationality_id'
];
public function lead()
@ -65,4 +67,9 @@ class LeadParticipant extends Model
{
return $this->belongsTo(Salutation::class, 'participant_salutation_id');
}
public function travel_nationality()
{
return $this->belongsTo(TravelNationality::class, 'nationality_id');
}
}

View file

@ -5,6 +5,7 @@ namespace App\Repositories;
use App\Models\Lead;
use App\Models\LeadNotice;
use App\Models\LeadParticipant;
use App\Models\StatusHistory;
class LeadRepository extends BaseRepository {
@ -42,7 +43,6 @@ class LeadRepository extends BaseRepository {
return $model;
}
public function updateLead($id, $data)
{
$this->model = Lead::findOrFail($id);
@ -91,9 +91,34 @@ class LeadRepository extends BaseRepository {
StatusHistory::create($fill);
}
}
return $this->model;
}
public function updateLeadParticipant($id, $data){
$this->model = Lead::findOrFail($id);
if(isset($data['participant'])){
foreach($data['participant'] as $p_id => $fill){
$Participant = LeadParticipant::findOrFail($p_id);
if($Participant->lead_id !== $this->model->id){
abort(500);
}
$fill['participant_child'] = isset($fill['participant_child']) ? true : false;
$fill['participant_birthdate'] = isset($fill['participant_birthdate']) ? _reformat_date($fill['participant_birthdate']) : null;
$Participant->fill($fill);
$Participant->save();
}
}
//main
$this->model->participant_salutation_id = isset($data['participant_salutation_id']) ? $data['participant_salutation_id'] : null;
$this->model->participant_name = isset($data['participant_name']) ? $data['participant_name'] : null;
$this->model->participant_firstname = isset($data['participant_firstname']) ? $data['participant_firstname'] : null;
//$this->model->nationality_id = isset($data['nationality_id']) ? $data['nationality_id'] : null;
$this->model->participant_birthdate = isset($data['participant_birthdate']) ? _reformat_date($data['participant_birthdate']) : null;
$this->model->save();
return $this->model;
}
}

View file

@ -9,7 +9,7 @@ use App\Models\Lead;
class Placeholder
{
public static $booking = [
public static $placeholder_booking = [
'dear' => '#geehrte/r#',
'salutation' => '#Anrede#',
'title' => '#Titel#',
@ -24,9 +24,51 @@ class Placeholder
'airline' => '#Airline#'
];
public static function getBookingQuill(){
public static $placeholder_lead = [
'dear' => '#geehrte/r#',
'salutation' => '#Anrede#',
'title' => '#Titel#',
'first_name' => '#Vorname#',
'last_name' => '#Nachname#',
'country' => '#Reiseland#',
'program' => '#Programm#',
'start_date' => '#Anreisedatum#',
'end_date' => '#Abreisedatum#',
'participants' => '#Teilnehmer#',
'booking_date' => '#Buchungsdatum#',
];
public static $placeholder_fewo= [
'dear' => '#geehrte/r#',
'salutation' => '#Anrede#',
'title' => '#Titel#',
'first_name' => '#Vorname#',
'last_name' => '#Nachname#',
'program' => '#Programm#',
'start_date' => '#Anreisedatum#',
'end_date' => '#Abreisedatum#',
'booking_date' => '#Buchungsdatum#',
];
public static function getOptionsQuill($key){
$ret = "";
foreach (self::$booking as $key => $value) {
switch ($key) {
case 'booking':
$placehoder = self::$placeholder_booking;
break;
case 'lead':
$placehoder = self::$placeholder_lead;
break;
case 'fewo':
$placehoder = self::$placeholder_fewo;
break;
default:
$placehoder = self::$placeholder_booking;
break;
}
foreach ($placehoder as $key => $value) {
$value = str_replace('#', '', $value);
$ret .= "{id: '".$value."', label: '".$value."'},"."\n";
}
@ -35,12 +77,31 @@ class Placeholder
public static function getBookingOptions(){
$ret = "";
foreach (self::$booking as $key => $value) {
foreach (self::$placeholder_booking as $key => $value) {
$value = str_replace('#', '', $value);
$ret .= '<option value="'.$value.'">'.$value.'</option>'."\n";
}
return $ret;
}
public static function getLeadOptions(){
$ret = "";
foreach (self::$placeholder_lead as $key => $value) {
$value = str_replace('#', '', $value);
$ret .= '<option value="'.$value.'">'.$value.'</option>'."\n";
}
return $ret;
}
public static function getFewoOptions(){
$ret = "";
foreach (self::$placeholder_fewo as $key => $value) {
$value = str_replace('#', '', $value);
$ret .= '<option value="'.$value.'">'.$value.'</option>'."\n";
}
return $ret;
}
public static function replaceBooking(Booking $booking, $content)
{
@ -50,7 +111,7 @@ class Placeholder
$title = $booking->customer->title;
$country = $booking->travel_country_id ? $booking->travel_country->name : "-";
$program = $booking->travelagenda_id ? $booking->travel_agenda->name : "-";
$salutation = isset($booking->customer->salutation) ? $booking->customer->salutation->name : '';
$salutation = isset($booking->customer->salutation) ? $booking->customer->salutation->name : '-';
$start_date = $booking->getStartDateFormat();
$end_date = $booking->getEndDateFormat();
$booking_date = $booking->getBookingDateFormat();
@ -78,7 +139,7 @@ class Placeholder
$search = [];
$replace = [];
foreach (self::$booking as $key => $value) {
foreach (self::$placeholder_booking as $key => $value) {
$search[] = $value;
$replace[] = ${$key};
}
@ -94,18 +155,14 @@ class Placeholder
$first_name = $booking_fewo->travel_user->first_name;
$last_name = $booking_fewo->travel_user->last_name;
$title = $booking_fewo->travel_user->title;
$country = "";
$program = $booking_fewo->fewo_lodging_id ? $booking_fewo->fewo_lodging->name : "-";
$salutation = $booking_fewo->travel_user->salutation_id == 1 ? 'Herr' : 'Frau';
$start_date = $booking_fewo->from_date;
$end_date = $booking_fewo->to_date;
$booking_date = $booking_fewo->booking_date;
$participants = "";
$airline = "";
$search = [];
$replace = [];
foreach (self::$booking as $key => $value) {
foreach (self::$placeholder_fewo as $key => $value) {
$search[] = $value;
$replace[] = ${$key};
}
@ -121,14 +178,13 @@ class Placeholder
$first_name = $lead->customer->firstname;
$last_name = $lead->customer->name;
$title = $lead->customer->title;
$country = "";
$program = "";
$country = $lead->travelcountry_id ? $lead->travel_country->name : "-";
$program = $lead->travelagenda_id ? $lead->travel_agenda->name : "-";
$salutation = $lead->customer->salutation_id == 1 ? 'Herr' : 'Frau';
$start_date = $lead->travelperiod_start ? _format_date($lead->travelperiod_start) : '';
$end_date = $lead->travelperiod_end ? _format_date($lead->travelperiod_end) : '';
$booking_date = $lead->request_date ? _format_date($lead->request_date) : '';
$start_date = $lead->travelperiod_start ? _format_date($lead->travelperiod_start) : '-';
$end_date = $lead->travelperiod_end ? _format_date($lead->travelperiod_end) : '-';
$booking_date = $lead->request_date ? _format_date($lead->request_date) : '-';
$participants = "";
$airline = "";
if($lead->lead_participants->count()){
$participants = "Teilnehmer:<br>";
foreach($lead->lead_participants as $participant){
@ -140,12 +196,9 @@ class Placeholder
$participants .= '<br>';
}
}
$search = [];
$replace = [];
foreach (self::$booking as $key => $value) {
foreach (self::$placeholder_lead as $key => $value) {
$search[] = $value;
$replace[] = ${$key};
}

View file

@ -24,7 +24,9 @@ class CreateLeadParticipantTable extends Migration
$table->string('participant_firstname', 255)->nullable();
$table->date('participant_birthdate')->nullable();
$table->bigInteger('participant_salutation_id')->nullable();
$table->tinyInteger('participant_child')->nullable()->default(0);
$table->unsignedInteger('nationality_id')->nullable();
$table->index('lead_id', 'lead_participant_lead_id_idx');
$table->index('participant_salutation_id', 'lead_participant_participant_salutation_id_idx');

View file

@ -143,8 +143,42 @@ $(function() {
});
});
function loadModalPreviewInner(self, data){
var url = data.route;
$.ajax({
url: url,
data: data,
type: "POST",
dataType: "json",
cache: false,
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
encode: true,
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function(data) {
console.log(data);
$(data.response.target).find('.modal-title').html(data.response.subject);
$(data.response.target).find('.modal-body').html(data.html);
},
error: function(xhr, status, errorThrown) {
console.log(xhr);
console.log(xhr.responseText);
console.log(errorThrown);
console.log("Sorry, there was a problem!");
}
});
return false;
}
$(function () {
$('.modal').on("hidden.bs.modal", function (e) {
if ($('.modal:visible').length) {
$('body').addClass('modal-open');
}
});
$('#modals-load-content').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget);
if (!button.data('id')) {

View file

@ -297,7 +297,7 @@
@if(Auth::user()->isPermission('sua-st-co'))
<br><div class="float-left small">Landesspezifische Dateien unter: <a href="{{route('admin_settings_travel_country', [])}}">Einstellungen -> Reieseländer</a></div>
@endif
<br><div class="float-left small">Passolution Dateien aktualisieren: <a class="ml-2 btn btn-xs btn-warning" href="{{ route('booking_delete', [$booking->id, 'passolution_file']) }}" onclick="return confirm('{{__('Wirklich löschen?')}}');"><i class="fa fa-sync"></i></a>
<br><div class="float-left small">Passolution Dateien aktualisieren: <a class="ml-2 btn btn-xs btn-warning" href="{{ route('booking_delete', [$booking->id, 'passolution_file']) }}" onclick="return confirm('{{__('Einreisebestimmungen erneuern?')}}');"><i class="fa fa-sync"></i></a>
</div>

View file

@ -163,6 +163,12 @@
<select class="ql-placeholder">
{!! \App\Services\Placeholder::getBookingOptions() !!}
</select>
<span class="ql-formats">
<button class="ql-preview" id="open_modal_quill_preview"
data-route="{{ route('customer_mail_ajax') }}"
data-booking_id="{{ $value->booking->id }}"
data-action="load_preview_mail"><i class="fa fa-eye"></i></button>
</span>
</span>
</div>
<div id="message-editor" style="height: 400px">{!! $value->message !!}</div>
@ -347,8 +353,21 @@
}
})
}
$(document).ready(function() {
$('#open_modal_quill_preview').on('click', function (event) {
data = {};
$.each($(this).data(), function(index, value){
data[index] = value;
});
data['content'] = $('#message-editor .ql-editor').html();
data['subject'] = $('input#subject').val();
data['target'] = '#modal_quill_preview';
loadModalPreviewInner(this, data);
$('#modal_quill_preview').modal('show');
});
change_mail_subdir_select();
$('#send_mail_dir').on('change', function () {
change_mail_subdir_select();
@ -365,7 +384,7 @@
toolbar: '#message-editor-toolbar',
placeholder: {
placeholders: [
{!! \App\Services\Placeholder::getBookingQuill() !!}
{!! \App\Services\Placeholder::getOptionsQuill('booking') !!}
]
}
},

View file

@ -4,6 +4,23 @@
</div>
</div>
@if(isset($show_modal_quill_preview))
<div class="modal fade" id="modal_quill_preview" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">E-Mail Vorschau</h4>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary w-100" data-dismiss="modal">{{ trans('laravel-filemanager::lfm.btn-close') }}</button>
</div>
</div>
</div>
</div>
@endif
@if(isset($lfm_helper))
<div class="modal fade" id="modal_iq_assets" tabindex="-1" role="dialog">
<div class="modal-xl modal-dialog ">

View file

@ -163,7 +163,7 @@
<!-- Application javascripts -->
<script src="{{ mix('/js/application.js') }}"></script>
<script src="{{ asset('/js/custom.js') }}?v=10{{ get_file_last_time('/js/custom.js') }}"></script>
<script src="{{ asset('/js/custom.js') }}?v=11{{ get_file_last_time('/js/custom.js') }}"></script>
@include('asset.js')

View file

@ -42,6 +42,60 @@
</tr>
@endif
@endforeach
@if($lead->travel_country_crm)
@foreach($lead->travel_country_crm->getContactLandsModels() as $TravelCountry)
@if($TravelCountry->stern_travel_country)
@foreach($TravelCountry->stern_travel_country->general_files as $general_files)
<tr>
<th scope="row">{{$lead_files_count++}}</th>
<td>
<a target="_blank" href="{{ $general_files->getURL() }}" class="badge badge-md badge-info">
<i class="{{$general_files->getIconExt()}} mr-1"></i> {{$general_files->original_name}}
</a>
</td>
<td>
@if(Auth::user()->isPermission('sua-st-co'))
<a href="{{route('admin_settings_travel_country_detail', [$TravelCountry->stern_travel_country->id, 'data'])}}">{{$TravelCountry->stern_travel_country->name }}</a> |
@endif
{{ $general_files->mine }} | {{ $general_files->formatBytes() }}
</td>
<td>{{\App\Services\Util::_format_date($general_files->created_at, 'date')}}</td>
<td>
<a href="{{ $general_files->getURL('download') }}" class="btn btn-xs btn-default"
title="Download" data-placement="left" rel="tooltip">
<i class="fa fa-download"></i>
</a>
</td>
</tr>
@endforeach
@endif
@endforeach
@endif
@foreach($lead->getPassolutionPDF() as $PassolutionPDF)
@if($PassolutionPDF)
<tr>
<th scope="row">{{$lead_files_count++}}</th>
<td>
<a target="_blank" href="{{ $PassolutionPDF['url'] }}?t={{ time() }}" class="badge badge-md badge-next">
<i class="fa fa-file-pdf mr-1"></i> {{$PassolutionPDF['filename']}}
</a>
</td>
<td>
Passolution |
{{ \App\Services\Util::_formatBytes($PassolutionPDF['size']) }}
</td>
<td>{{\App\Services\Util::_format_date($PassolutionPDF['date'], 'date')}}</td>
<td>
<a href="{{ $PassolutionPDF['url'] }}?t={{ time() }}" class="btn btn-xs btn-default"
title="Download" data-placement="left" rel="tooltip" download="">
<i class="fa fa-download"></i>
</a>
</td>
</tr>
@endif
@endforeach
@if($lead->lead_files)
@foreach($lead->lead_files as $lead_file)
@ -76,6 +130,11 @@
@if(Auth::user()->isPermission('sua-st-em'))
<div class="float-left small">Allgemeine Dateien unter: <a href="{{route('admin_settings_emails', ['settings'])}}">Einstellungen -> E-Mails / Einstellungen</a></div>
@endif
@if(Auth::user()->isPermission('sua-st-co'))
<br><div class="float-left small">Landesspezifische Dateien unter: <a href="{{route('admin_settings_travel_country', [])}}">Einstellungen -> Reieseländer</a></div>
@endif
<br><div class="float-left small">Passolution Dateien aktualisieren: <a class="ml-2 btn btn-xs btn-warning" href="{{ route('lead_delete', [$lead->id, 'passolution_file']) }}" onclick="return confirm('{{__('Einreisebestimmungen erneuern?')}}');"><i class="fa fa-sync"></i></a>
</div>
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal"
data-target="#modals-load-content"
data-id="new-file"

View file

@ -0,0 +1,93 @@
<div class="card mb-2">
<h6 class="card-header bg-primary text-white py-2" data-toggle="collapse" data-target="#collapseLeadParticipant" aria-expanded="false" aria-controls="collapseLeadParticipant">
<strong style="line-height: 1.6em">Teilnehmer</strong>
</h6>
<div class="collapse" id="collapseLeadParticipant">
<div class="card-body row">
<div class="table-responsive" id="booking_files_table">
<table class="table table-striped table-sm">
<thead>
<tr>
<th>Anrede</th>
<th>Vorname</th>
<th>Nachname</th>
<th>Geburtsdatum</th>
<th>Nationalität</th>
<th>Kind</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
@if($lead->participant_firstname)
<tr>
<th scope="row">
{{ Form::select('participant_salutation_id', \App\Services\Model::getSalutationArray(false) , $lead->participant_salutation_id, array('class'=>'custom-select', 'id'=>'participant_salutation_id')) }}
</th>
<td>
{{ Form::text('participant_firstname', $lead->participant_firstname, array('placeholder'=>__('Vorname'), 'class'=>'form-control', 'id'=>'participant_firstname')) }}
</td>
<td>
{{ Form::text('participant_name', $lead->participant_name, array('placeholder'=>__('Nachname'), 'class'=>'form-control', 'id'=>'participant_name')) }}
</td>
<td>
{{ Form::text('participant_birthdate', _format_date($lead->participant_birthdate), array('placeholder'=>__('Datum'), 'class'=>'form-control datepicker-base', 'id'=>'participant_birthdate')) }}
</td>
<td>
&nbsp;
</td>
<td>
&nbsp;
</td>
<td>
&nbsp;
</td>
</tr>
@endif
@if($lead->lead_participants)
@foreach($lead->lead_participants as $item)
<tr>
<th scope="row">
{{ Form::select('participant['.$item->id.'][participant_salutation_id]', \App\Services\Model::getSalutationArray(false) , $item->participant_salutation_id, array('class'=>'custom-select', 'id'=>'participant_'.$item->id.'_participant_salutation_id')) }}
</th>
<td>
{{ Form::text('participant['.$item->id.'][participant_firstname]', $item->participant_firstname, array('placeholder'=>__('Vorname'), 'class'=>'form-control', 'id'=>'participant_'.$item->id.'_participant_firstname')) }}
</td>
<td>
{{ Form::text('participant['.$item->id.'][participant_name]', $item->participant_name, array('placeholder'=>__('Nachname'), 'class'=>'form-control', 'id'=>'participant_'.$item->id.'_participant_name')) }}
</td>
<td>
{{ Form::text('participant['.$item->id.'][participant_birthdate]', _format_date($item->participant_birthdate), array('placeholder'=>__('Datum'), 'class'=>'form-control datepicker-base', 'id'=>'participant_'.$item->id.'_participant_birthdate')) }}
</td>
<td>
{{ Form::select('participant['.$item->id.'][nationality_id]', \App\Services\Model::getTravelNationalityArray(false) , $item->nationality_id, array('class'=>'custom-select', 'id'=>'participant_'.$item->id.'_nationality_id')) }}
</td>
<td>
<label class="custom-control custom-checkbox mt-2">
{!! Form::checkbox('participant['.$item->id.'][participant_child]', 1, $item->participant_child, ['class'=>'custom-control-input', 'id'=>'participant_'.$item->id.'_participant_child']) !!}
<span class="custom-control-label"></span>
</label>
</td>
<td>
<a class="btn btn-sm text-danger" href="{{ route('lead_delete', [$item->id, 'participant']) }}" onclick="return confirm('{{__('Wirklich löschen?')}}');"><i class="fa fa-trash-alt"></i></a>
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
<div class="col-12">
<hr>
<div class="text-left mt-3">
<button type="submit" name="action" value="update_lead_participant" class="btn btn-sm btn-secondary">{{ __('save changes') }}</button>&nbsp;
<a href="{{route('leads')}}" class="btn btn-sm btn-default">{{ __('zur Übersicht') }}</a>
<a href="{{route('lead_action', ['lead_participant_add', $lead->id])}}" class="btn btn-sm btn-primary float-right ml-2"><i class="fa fa-plus-circle"></i> {{ __('Neuen Teilnehmer') }}</a>
</div>
</div>
</div>
</div>
</div>

View file

@ -57,6 +57,11 @@
Status
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="javascript:void(0)" data-collapse="#collapseLeadParticipant">
Teilnehmer
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="javascript:void(0)" data-collapse="#collapseLeadBooking">
Buchung
@ -88,6 +93,10 @@
@include('lead._detail_lead')
<!-- Status -->
@include('lead._detail_status')
@if($id !== "new" && $lead)
@include('lead._detail_participant')
@endif
{!! Form::close() !!}
@if($id !== "new" && $lead)

View file

@ -35,6 +35,57 @@
@endif
@endforeach
@if($lead->travel_country_crm)
@foreach($lead->travel_country_crm->getContactLandsModels() as $TravelCountry)
@if($TravelCountry->stern_travel_country)
@foreach($TravelCountry->stern_travel_country->general_files as $general_files)
<tr>
<th scope="row">{{$lead_files_count++}}</th>
<td>
<a target="_blank" href="{{ $general_files->getURL() }}" class="badge badge-md badge-info">
<i class="{{$general_files->getIconExt()}} mr-1"></i> {{$general_files->original_name}}
</a>
</td>
<td>
{{ $general_files->mine }} | {{ $general_files->formatBytes() }}
</td>
<td>{{\App\Services\Util::_format_date($general_files->created_at, 'date')}}</td>
<td>
<button data-target="{{ $general_files->getURL() }}" data-name="{{ $general_files->original_name }}" class="btn btn-xs btn-primary add-file-to-attachment"
title="als Anhang hinzufügen" data-placement="left" rel="tooltip">
<i class="fa fa-cloud-download-alt"></i>
</button>
</td>
</tr>
@endforeach
@endif
@endforeach
@endif
@foreach($lead->getPassolutionPDF() as $PassolutionPDF)
@if($PassolutionPDF)
<tr>
<th scope="row">{{$lead_files_count++}}</th>
<td>
<a target="_blank" href="{{ $PassolutionPDF['url'] }}" class="badge badge-md badge-next">
<i class="fa fa-file-pdf mr-1"></i> {{$PassolutionPDF['filename']}}
</a>
</td>
<td>
Passolution |
{{ \App\Services\Util::_formatBytes($PassolutionPDF['size']) }}
</td>
<td>{{\App\Services\Util::_format_date($PassolutionPDF['date'], 'date')}}</td>
<td>
<button data-target="{{ $PassolutionPDF['url'] }}" data-name="{{$PassolutionPDF['filename']}}" class="btn btn-xs btn-primary add-file-to-attachment"
title="als Anhang hinzufügen" data-placement="left" rel="tooltip">
<i class="fa fa-cloud-download-alt"></i>
</button>
</td>
</tr>
@endif
@endforeach
@if($lead->lead_files)
@foreach($lead->lead_files as $lead_file)
<tr>

View file

@ -119,7 +119,6 @@
{{ Form::text('subject', $value->subject, array('placeholder'=>$value->s_placeholder, 'id'=>'subject', 'class'=>'form-control', 'required')) }}
</div>
</div>
<div class="form-group mb-1">
<label class="form-label" for="message">Nachricht</label>
@if($value->show === 'single' || $value->show === 'multi')
@ -129,38 +128,47 @@
@endif
<div id="message-editor-toolbar">
<span class="ql-formats">
<button class="ql-bold"></button>
<button class="ql-italic"></button>
<button class="ql-underline"></button>
<button class="ql-strike"></button>
</span>
<button class="ql-bold"></button>
<button class="ql-italic"></button>
<button class="ql-underline"></button>
<button class="ql-strike"></button>
</span>
<span class="ql-formats">
<button class="ql-header" value="1"></button>
<button class="ql-header" value="2"></button>
<button class="ql-blockquote"></button>
<button class="ql-code-block"></button>
</span>
<button class="ql-header" value="1"></button>
<button class="ql-header" value="2"></button>
<button class="ql-blockquote"></button>
<button class="ql-code-block"></button>
</span>
<span class="ql-formats">
<button class="ql-list" value="ordered"></button>
<button class="ql-list" value="bullet"></button>
<button class="ql-indent" value="-1"></button>
<button class="ql-indent" value="+1"></button>
</span>
<button class="ql-list" value="ordered"></button>
<button class="ql-list" value="bullet"></button>
<button class="ql-indent" value="-1"></button>
<button class="ql-indent" value="+1"></button>
</span>
<span class="ql-formats">
<select class="ql-align"></select>
</span>
<select class="ql-align"></select>
</span>
<span class="ql-formats">
<button class="ql-clean"></button>
</span>
<button class="ql-clean"></button>
</span>
<span class="ql-formats">
<select class="ql-placeholder">
{!! \App\Services\Placeholder::getBookingOptions() !!}
{!! \App\Services\Placeholder::getLeadOptions() !!}
</select>
</span>
<span class="ql-formats">
<button class="ql-preview" id="open_modal_quill_preview"
data-route="{{ route('lead_mail_ajax') }}"
data-lead_id="{{ $value->lead->id }}"
data-action="load_preview_mail"><i class="fa fa-eye"></i></button>
</span>
</div>
<div id="message-editor" style="height: 400px">{!! $value->message !!}</div>
{{ Form::textarea('message', $value->message, array('placeholder'=>$value->m_placeholder, 'id'=>'message-editor-fallback', 'class'=>'form-control d-none', 'rows'=>15)) }}
</div>
@if($value->show === 'single' || $value->show === 'multi')
<div class="row">
<div class="col-12">
@ -300,7 +308,6 @@
</div>
</div>
<script type="text/javascript">
function callback_ajax_add_attachment(response) {
@ -342,6 +349,19 @@
}
$(document).ready(function() {
$('#open_modal_quill_preview').on('click', function (event) {
data = {};
$.each($(this).data(), function(index, value){
data[index] = value;
});
data['content'] = $('#message-editor .ql-editor').html();
data['subject'] = $('input#subject').val();
data['target'] = '#modal_quill_preview';
loadModalPreviewInner(this, data);
$('#modal_quill_preview').modal('show');
});
change_mail_subdir_select();
$('#send_mail_dir').on('change', function () {
change_mail_subdir_select();
@ -358,7 +378,7 @@
toolbar: '#message-editor-toolbar',
placeholder: {
placeholders: [
{!! \App\Services\Placeholder::getBookingQuill() !!}
{!! \App\Services\Placeholder::getOptionsQuill('lead') !!}
]
}
},

View file

@ -99,7 +99,7 @@
toolbar: '#message-editor-toolbar',
placeholder: {
placeholders: [
{!! \App\Services\Placeholder::getBookingQuill() !!}
{!! \App\Services\Placeholder::getOptionsQuill('booking') !!}
]
}
},

View file

@ -160,9 +160,15 @@
</span>
<span class="ql-formats">
<select class="ql-placeholder">
{!! \App\Services\Placeholder::getBookingOptions() !!}
{!! \App\Services\Placeholder::getFewoOptions() !!}
</select>
</span>
<span class="ql-formats">
<button class="ql-preview" id="open_modal_quill_preview"
data-route="{{ route('customer_fewo_mail_ajax') }}"
data-booking_fewo_id="{{ $value->booking->id }}"
data-action="load_preview_mail"><i class="fa fa-eye"></i></button>
</span>
</div>
<div id="message-editor" style="height: 400px">{!! $value->message !!}</div>
{{ Form::textarea('message', $value->message, array('placeholder'=>$value->m_placeholder, 'id'=>'message-editor-fallback', 'class'=>'form-control d-none', 'rows'=>15)) }}
@ -348,6 +354,20 @@
}
$(document).ready(function() {
$('#open_modal_quill_preview').on('click', function (event) {
data = {};
$.each($(this).data(), function(index, value){
data[index] = value;
});
data['content'] = $('#message-editor .ql-editor').html();
data['subject'] = $('input#subject').val();
data['target'] = '#modal_quill_preview';
loadModalPreviewInner(this, data);
$('#modal_quill_preview').modal('show');
});
change_mail_subdir_select();
$('#send_mail_dir').on('change', function () {
change_mail_subdir_select();
@ -364,7 +384,7 @@
toolbar: '#message-editor-toolbar',
placeholder: {
placeholders: [
{!! \App\Services\Placeholder::getBookingQuill() !!}
{!! \App\Services\Placeholder::getOptionsQuill('fewo') !!}
]
}
},

View file

@ -91,10 +91,9 @@ Route::group(['middleware' => ['admin']], function()
{
Route::post('/modal/load', 'ModalController@load')->name('modal_load');
Route::post('/ajax/load/data', 'AjaxController@load')->name('ajax_load_data');
Route::post('/iq/content/modal/load', 'IQ\ContentModalController@load')->name('iq_content_modal_load');
Route::post('customer_mail/ajax', 'CustomerMailController@ajax')->name('customer_mail_ajax');
//trees
Route::get('/iq/content/tree/index', 'IQ\ContentTreeController@index')->name('iq_content_tree_index');
@ -112,9 +111,8 @@ Route::group(['middleware' => ['admin']], function()
Route::get('/customer_mail/data/table', 'CustomerMailController@getRequests')->name('customer_mail_data_table');
Route::get('/email_template/data/table', 'CustomerMailController@getEmailTemplates')->name('email_template_data_table');
Route::get('/customer_mail/delete/{id}', 'CustomerMailController@delete')->name('customer_mail_delete');
Route::post('/ajax/load/data', 'AjaxController@load')->name('ajax_load_data');
Route::get('/customer_mail/delete/{id}', 'CustomerMailController@delete')->name('customer_mail_delete');
Route::post('customer_mail/ajax', 'CustomerMailController@ajax')->name('customer_mail_ajax');
Route::get('/customer_mail/detail/{id}', 'CustomerMailController@detail')->name('customer_mail_detail');
Route::post('/customer_mail/detail/{id}/{action?}', 'CustomerMailController@store')->name('customer_mail_detail');
@ -137,13 +135,10 @@ Route::group(['middleware' => ['admin']], function()
Route::post('/lead_mail/modal/load', 'LeadMailController@loadModal')->name('lead_mail_modal_load');
Route::post('lead_mail/detail{id}/{action?}', 'LeadMailController@store')->name('lead_mail_detail');
Route::group(['middleware' => ['auth.permission:cms-iq-assets']], function() {
//assets
Route::get('/iq/content/assets', 'IQ\ContentAssetController@index')->name('iq_content_assets');
Route::get('/iq/content/assets/modal', 'IQ\ContentAssetController@modal')->name('iq_content_assets_modal');
});
Route::group(['middleware' => ['auth.permission:crm-tp-pr']], function() {
//Reiseprogramme Programme
@ -206,10 +201,11 @@ Route::group(['middleware' => ['admin']], function()
Route::get('/leads/{step?}', 'LeadController@index')->name('leads');
Route::get('/lead/detail/{id}', 'LeadController@detail')->name('lead_detail');
Route::post('/lead/detail/{id}', 'LeadController@store')->name('lead_detail');
Route::get('/lead/delete/{id}/{del?}', 'LeadController@delete')->name('lead_delete');
Route::post('/lead/modal/load', 'LeadController@loadModal')->name('lead_modal_load');
Route::get('/lead/action/{action}/{id?}', 'LeadController@action')->name('lead_action');
Route::post('/lead/action/{action}/{id?}', 'LeadController@action')->name('lead_action');
Route::post('lead/ajax/requests', 'LeadController@getAjaxRequests')->name('lead_ajax_requests');
Route::get('/lead/delete/{id}/{del?}', 'LeadController@delete')->name('lead_delete');
});
Route::group(['middleware' => ['auth.permission:crm-bo-cu']], function() {
//Buchungen > Kunden

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB