Mails etc. in Lead finish

This commit is contained in:
Kevin Adametz 2021-05-11 17:07:20 +02:00
parent 66ca252bfa
commit b362b93bca
45 changed files with 1460 additions and 418 deletions

View file

@ -85,6 +85,7 @@
@endif
@endforeach
@foreach($booking::$customer_mail_dirs as $dir_id => $customer_mail_dir)
@php($badge = "badge-outline-primary")
<a href="javascript:void(0)" class="d-flex justify-content-between align-items-center py-2 px-4 sidebox-nav-item"
data-dir="{{$dir_id}}" data-subdir="0" data-icon="{{$customer_mail_dir['icon']}}" data-name="{{$customer_mail_dir['name']}}">
<div class="item">

View file

@ -30,26 +30,6 @@
</div>
</div>
<hr class="border-light m-0">
<!-- / Header -->
{{-- <!-- Controls -->
<div class="media flex-wrap align-items-center p-2">
<div class="media-body d-flex flex-wrap flex-basis-100 flex-basis-sm-auto">
<button type="button" class="btn btn-default borderless md-btn-flat icon-btn messages-tooltip text-muted mr-3" title="Back"><i class="ion ion-md-arrow-back"></i></button>
<button type="button" class="btn btn-default borderless md-btn-flat icon-btn messages-tooltip text-muted" title="Mark as unread"><i class="ion ion-md-mail-unread"></i></button>
<button type="button" class="btn btn-default borderless md-btn-flat icon-btn messages-tooltip text-muted" title="Mark as important"><i class="ion ion-md-alert"></i></button>
<button type="button" class="btn btn-default borderless md-btn-flat icon-btn messages-tooltip text-muted" title="Move to spam"><i class="ion ion-md-folder-open"></i></button>
<button type="button" class="btn btn-default borderless md-btn-flat icon-btn messages-tooltip text-muted" title="Move to trash"><i class="ion ion-md-trash"></i></button>
</div>
<div class="d-flex flex-wrap align-items-center ml-auto">
<button type="button" class="btn btn-default borderless md-btn-flat text-muted px-3"><i class="ion ion-ios-undo"></i>&nbsp; Reply</button>
<div class="text-lighter">|</div>
<button type="button" class="btn btn-default borderless md-btn-flat text-muted px-3">Forward &nbsp;<i class="ion ion-ios-redo"></i></button>
</div>
</div>
<hr class="border-light m-0">
<!-- / Controls -->
--}}
<div class="p-4">
{!! nl2br($customer_mail->message) !!}
</div>
@ -152,7 +132,7 @@
</div>
<div class="col-sm-6">
<button type="submit" class="btn btn-xs btn-default float-right mt-1" onclick="return confirm('{{__('Wirklich weiterleiten? E-Mail wird erneut gesendet!')}}');"><i class="ion ion-ios-send"></i>&nbsp; weiterleiten</button>
</div
</div>
</div>
{!! Form::close() !!}
</div>

View file

@ -236,7 +236,7 @@
@endforeach
@endif
</div>
<div class="card-body mb-2" style="background: #fff; border: 1px solid rgba(24, 28, 33, 0.06);">
<h4>{{__('Notizen') }} FeWo <span class=" text-muted">letzten 10</span></h4>
@ -269,6 +269,39 @@
@endforeach
@endif
</div>
<div class="card-body mb-2" style="background: #fff; border: 1px solid rgba(24, 28, 33, 0.06);">
<h4>{{__('Notizen') }} Anfragen <span class=" text-muted">letzten 10</span></h4>
@if($last_lead_notices)
@foreach($last_lead_notices as $lead_notice)
<div class="row">
<div class="col-sm-12">
@if($lead_notice->from_user_id === \Auth::user()->id)
<div class="bg-primary rounded py-2 px-3 mr-3 text-white mb-2">
@else
<div class="bg-secondary rounded py-2 px-3 mr-3 mb-2">
@endif
<div class="font-weight-semibold mb-1">{{ $lead_notice->getName() }} | {{ $lead_notice->created_at->format("d.m.Y - H:i:s") }}
@if($lead_notice->edit_at != null)
| <i class="ion ion-ios-create"></i> {{ $lead_notice->edit_at->format("d.m.Y - H:i:s") }}
@endif
| <a class="btn btn-white btn-xs " href="{{ route('lead_detail', [$lead_notice->lead_id]) }}#collapseLeadNotice">zur Buchnung {{ $lead_notice->lead_id }}</a>
</div>
{!! nl2br($lead_notice->message) !!}
</div>
</div>
</div>
{{-- <div class="col-sm-12">
<div class="bg-lighter rounded py-2 px-3 mr-3 mb-2">
<div class="font-weight-semibold mb-1">You | {{ $lead_notice->created_at->format("d.m.Y H:i:s") }}</div>
{!! nl2br($lead_notice->message) !!}
</div>
</div>
--}}
@endforeach
@endif
</div>
@endif
<div class="card-body mb-2" style="background: #fff; border: 1px solid rgba(24, 28, 33, 0.06);">

View file

@ -1,43 +1,42 @@
<div class="card mb-2">
<h6 class="card-header bg-primary text-white py-2" data-toggle="collapse" data-target="#collapseBookingMails" aria-expanded="false" aria-controls="collapseBookingMails">
<h6 class="card-header bg-primary text-white py-2" data-toggle="collapse" data-target="#collapseLeadMails" aria-expanded="false" aria-controls="collapseLeadMails">
<strong style="line-height: 1.6em">E-Mails</strong>
<span class="badge badge-secondary">{{$travel_user_booking_fewo->customer_fewo_mails->count()}}</span>
<span class="badge badge-secondary">{{$lead->lead_mails->count()}}</span>
</h6>
<div class="collapse" id="collapseBookingMails">
<div class="collapse" id="collapseLeadMails">
<div class="container-fluid d-flex align-items-stretch flex-grow-1 p-0">
<!-- `.messages-wrapper` fills all available space of container -->
<div class="messages-wrapper">
<!-- Messages sidebox -->
<div class="messages-sidebox messages-scroll bg-body border-right">
<div class="py-3 px-4">
<div class="media align-items-center">
<div class="media-body text-center">
<button type="button" class="btn btn-sm btn-secondary mb-3 btn-compare-customer-mails" data-toggle="modal"
data-target="#modals-load-content"
data-id="new-send"
data-model="CustomerFewoMail"
data-action="new-customer-mail"
data-url="{{route('customer_fewo_mail_send_mail')}}"
data-model="LeadMail"
data-action="new-lead-mail"
data-url="{{route('lead_mail_send_mail')}}"
data-redirect="back"
data-travel_user_booking_fewo_id="{{$travel_user_booking_fewo->id}}"
data-customer_mail_dir="0"
data-customer_mail_subdir="0"
data-route="{{ route('customer_fewo_modal_load') }}"><i class="ion ion-md-mail-open"></i>&nbsp;E-Mail schreiben</button>
data-lead_id="{{$lead->id}}"
data-lead_mail_dir="0"
data-lead_mail_subdir="0"
data-route="{{ route('lead_mail_modal_load') }}"><i class="ion ion-md-mail-open"></i>&nbsp;E-Mail schreiben</button>
<button type="button" class="btn btn-sm btn-next btn-compare-customer-mails" data-toggle="modal"
data-target="#modals-load-content"
data-id="new-save"
data-model="CustomerFewoMail"
data-action="reply-customer-mail"
data-url="{{route('customer_fewo_mail_reply_mail')}}"
data-model="LeadMail"
data-action="reply-lead-mail"
data-url="{{route('lead_mail_reply_mail')}}"
data-redirect="back"
data-travel_user_booking_fewo_id="{{$travel_user_booking_fewo->id}}"
data-customer_mail_dir="0"
data-customer_mail_subdir="0"
data-route="{{ route('customer_fewo_modal_load') }}"><i class="ion ion-md-mail-unread"></i>&nbsp;Antwort speichern</button>
data-lead_id="{{$lead->id}}"
data-lead_mail_dir="0"
data-lead_mail_subdir="0"
data-route="{{ route('lead_mail_modal_load') }}"><i class="ion ion-md-mail-unread"></i>&nbsp;Antwort speichern</button>
</div>
<a href="javascript:void(0)" class="messages-sidebox-toggler d-lg-none d-block text-muted text-large font-weight-light pl-4">&times;</a>
</div>
@ -62,32 +61,30 @@
</style>
<!-- Mail boxes -->
@foreach(\App\Services\BookingFewo::getCustomerMailDirs() as $customer_mail_dir)
@php($badge = $customer_mail_dir->pos === 0 ? "badge-primary" : "badge-outline-primary")
<a href="javascript:void(0)" class="d-flex justify-content-between align-items-center py-2 px-4 sidebox-nav-item @if($customer_mail_dir->pos === 0) active @endif"
data-dir="{{$customer_mail_dir->pos}}" data-subdir="0" data-icon="{{$customer_mail_dir->getArrayContent('icon')}}" data-name="{{$customer_mail_dir->name}}">
@foreach(\App\Services\Lead::getCustomerMailDirs() as $lead_mail_dir)
@php($badge = $lead_mail_dir->pos === 0 ? "badge-primary" : "badge-outline-primary")
<a href="javascript:void(0)" class="d-flex justify-content-between align-items-center py-2 px-4 sidebox-nav-item @if($lead_mail_dir->pos === 0) active @endif"
data-dir="{{$lead_mail_dir->pos}}" data-subdir="0" data-icon="{{$lead_mail_dir->getArrayContent('icon')}}" data-name="{{$lead_mail_dir->name}}">
<div class="item">
<i class="ion {{$customer_mail_dir->getArrayContent('icon')}}"></i> {{$customer_mail_dir->name}}
<i class="ion {{$lead_mail_dir->getArrayContent('icon')}}"></i> {{$lead_mail_dir->name}}
</div>
<div class="badge {{$badge}}">{{$travel_user_booking_fewo->countCustomerMailsBy($customer_mail_dir->pos)}}</div>
<div class="badge {{$badge}}">{{$lead->countLeadMailsBy($lead_mail_dir->pos)}}</div>
</a>
@endforeach
@foreach($travel_user_booking_fewo::$customer_mail_dirs as $dir_id => $customer_mail_dir)
@foreach($lead::$lead_mail_dirs as $dir_id => $lead_mail_dir)
@php($badge = "badge-outline-primary")
<a href="javascript:void(0)" class="d-flex justify-content-between align-items-center py-2 px-4 sidebox-nav-item"
data-dir="{{$dir_id}}" data-subdir="0" data-icon="{{$customer_mail_dir['icon']}}" data-name="{{$customer_mail_dir['name']}}">
data-dir="{{$dir_id}}" data-subdir="0" data-icon="{{$lead_mail_dir['icon']}}" data-name="{{$lead_mail_dir['name']}}">
<div class="item">
<i class="ion {{$customer_mail_dir['icon']}}"></i> {{$customer_mail_dir['name']}}
<i class="ion {{$lead_mail_dir['icon']}}"></i> {{$lead_mail_dir['name']}}
</div>
<div class="badge {{$badge}}">{{$travel_user_booking_fewo->countCustomerMailsBy($dir_id)}}</div>
<div class="badge {{$badge}}">{{$lead->countLeadMailsBy($dir_id)}}</div>
</a>
@endforeach
<hr class="border-light m-4">
</div>
<!-- / Messages sidebox -->
<!-- Messages content wrapper -->
<div class="d-flex flex-column w-100">
<!-- Header -->
<div class="flex-grow-0">
<h4 class="media align-items-center font-weight-bold container-p-x py-3 py-lg-4 m-0">
<a href="javascript:void(0)" class="messages-sidebox-toggler d-lg-none d-block align-self-center text-muted px-3 mr-3"><i class="ion ion-md-more"></i></a>
@ -98,22 +95,18 @@
</h4>
<hr class="border-light m-0">
</div>
<!-- / Header -->
<style>
div.dataTables_info, div.dataTables_paginate {
padding: 10px;
}
</style>
<!-- Wrap `.messages-scroll` to properly position scroll area. Remove this wrapper if you don't need scroll -->
<div class="flex-grow-1 position-relative">
<!-- Remove `.messages-scroll` and add `.flex-grow-1` if you don't need scroll -->
<div class="messages-content flex-grow-1">
<div class="table-responsive" id="customer_mails_table">
<input type="hidden" name="travel_user_booking_fewo_id" value="{{$travel_user_booking_fewo->id}}">
<input type="hidden" name="customer_mail_dir" value="0">
<input type="hidden" name="customer_mail_subdir" value="">
<table id="datatables-customer-mails" class="table table-striped">
<div class="table-responsive" id="lead_mails_table">
<input type="hidden" name="lead_id" value="{{$lead->id}}">
<input type="hidden" name="lead_mail_dir" value="0">
<input type="hidden" name="lead_mail_subdir" value="">
<table id="datatables-lead-mails" class="table table-striped">
<thead>
<tr>
<th>&nbsp;</th>
@ -128,10 +121,10 @@
</table>
</div>
</div><!-- / .messages-content -->
</div>
</div>
</div>
</div><!-- / .messages-wrapper -->
</div>
</div>
</div>
</div>

View file

@ -4,12 +4,8 @@
<style>
body {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.btn-xs {
line-height: 1.3em;
@ -91,10 +87,7 @@
{!! Form::close() !!}
@if($id !== "new")
{{--
@include('lead._detail_mails')
--}}
@include('lead._detail_mails')
@include('lead._detail_files')
@endif
@ -105,9 +98,6 @@
<a href="{{ make_old_url('/index.php/leads/'.$lead->id.'/edit') }}" class="btn btn-sm btn-default float-right">{{ __('zurück ins CRM v2') }}</a>
</div>
<script>
$(document).ready(function() {
@ -165,20 +155,18 @@
}
init_site();
/*
var oTable = $('#datatables-customer-mails').DataTable({
var oTable = $('#datatables-lead-mails').DataTable({
"processing": true,
"serverSide": true,
"searching": false,
ajax: {
url: '{!! route( 'customer_fewo_mail_data_table' ) !!}',
url: '{!! route( 'lead_mail_data_table' ) !!}',
data: function(d) {
d.model = 'CustomerFewoMail';
d.travel_user_booking_fewo_id = $('#customer_mails_table input[name=travel_user_booking_fewo_id]').val();
d.customer_mail_dir = $('#customer_mails_table input[name=customer_mail_dir]').val();
d.customer_mail_subdir = $('#customer_mails_table input[name=customer_mail_subdir]').val();
d.model = 'LeadMail';
d.lead_id = $('#lead_mails_table input[name=lead_id]').val();
d.lead_mail_dir = $('#lead_mails_table input[name=lead_mail_dir]').val();
d.lead_mail_subdir = $('#lead_mails_table input[name=lead_mail_subdir]').val();
d.data_table_search = $('#dataTableInputSearchField').val();
}
},
@ -196,13 +184,13 @@
"url": "/js/German.json"
},
"drawCallback": function( settings ) {
$('#datatables-customer-mails [rel="tooltip"]').tooltip({trigger: "hover"});
$('#datatables-customer-mails .customer-mail-ajax-action').on('click', function (event) {
ajax_object_action(event, $(this), callback_customer_mails_data_table);
$('#datatables-lead-mails [rel="tooltip"]').tooltip({trigger: "hover"});
$('#datatables-lead-mails .lead-mail-ajax-action').on('click', function (event) {
ajax_object_action(event, $(this), callback_lead_mails_data_table);
});
}
});
function callback_customer_mails_data_table(data) {
function callback_lead_mails_data_table(data) {
if(data.status === 'success'){
oTable.draw();
}
@ -213,14 +201,14 @@
if($(this).hasClass('active')){
return;
}
$('#customer_mails_table input[name=customer_mail_dir]').val($(this).data('dir'));
$('#customer_mails_table input[name=customer_mail_subdir]').val($(this).data('subdir'));
$('#lead_mails_table input[name=lead_mail_dir]').val($(this).data('dir'));
$('#lead_mails_table input[name=lead_mail_subdir]').val($(this).data('subdir'));
if($(this).data('dir') <= 10){
$('.btn-compare-customer-mails').data('customer_mail_dir', $(this).data('dir'));
$('.btn-compare-customer-mails').data('customer_mail_subdir', $(this).data('subdir'));
$('.btn-compare-customer-mails').prop('disabled', false);
$('.btn-compare-lead-mails').data('lead_mail_dir', $(this).data('dir'));
$('.btn-compare-lead-mails').data('lead_mail_subdir', $(this).data('subdir'));
$('.btn-compare-lead-mails').prop('disabled', false);
}else{
$('.btn-compare-customer-mails').prop('disabled', true);
$('.btn-compare-lead-mails').prop('disabled', true);
}
oTable.draw();
$('.messages-wrapper .sidebox-nav-item').removeClass('active');
@ -236,9 +224,5 @@
});
});
*/
});
</script>
</script>
@endsection

View file

@ -8,7 +8,7 @@
<div class="card">
<div class="card-datatable table-responsive">
<table class="datatables-leads table table-striped table-bordered">
<table class="datatables-leads table table-striped table-bordered" id="datatables-leads">
<thead>
<tr>
@ -19,8 +19,11 @@
<th>{{__('Nachname')}}</th>
<th>{{__('E-Mail')}}</th>
<th>{{__('Anfrage-Datum')}}</th>
<th>{{__('N.')}}</th>
<th>{{__('Sachbearbeiter')}}</th>
<th>{{__('Status')}}</th>
<th>{{__('E-Mail')}}</th>
<th style="max-width: 60px;">{{__('delete')}}</th>
</tr>
</thead>
</table>
@ -29,7 +32,7 @@
<script>
$( document ).ready(function() {
$('.datatables-leads').dataTable({
var table = $('#datatables-leads').DataTable({
"processing": true,
"serverSide": true,
"ajax": '{!! route('data_table_leads') !!}',
@ -42,16 +45,55 @@
{ data: 'customer.name', name: 'customer.name' },
{ data: 'customer.email', name: 'customer.email' },
{ data: 'request_date', name: 'request_date' },
{ data: 'lead_notice', name: 'lead_notice', orderable: false },
{ data: 'sf_guard_user.last_name', name: 'sf_guard_user.last_name', searchable: false },
{ data: 'status', name: 'status' },
{ data: 'last_lead_email', name: 'last_lead_email', orderable: true },
{ data: 'action_delete', orderable: false, searchable: false},
],
"bLengthChange": false,
"iDisplayLength": 100,
"language": {
"url": "/js/German.json"
},
drawCallback: function () {
$('#datatables-leads [rel="tooltip"]').tooltip({trigger: "hover"});
$('#datatables-leads [data-toggle="popover"]').popover({trigger: "hover", content: get_popover_content, html: true,});
}
});
function get_popover_content() {
if ($(this).data('lead_id')) {
var data = {};
data['action'] = $(this).data('action');
data['lead_id'] = $(this).data('lead_id');
$(this).addClass("loading");
var icontent = $.ajax({
url: '{!! route( 'lead_ajax_requests' ) !!}',
data: data,
type: "POST",
dataType: "html",
cache: false,
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
encode: true,
async: false,
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function() {
// just get the response
},
error: function() {
// nothing
}
}).responseText;
$(this).removeClass("loading");
return icontent;
}
return "Keine Buchungs-ID";
}
});
</script>

View file

@ -0,0 +1,99 @@
<div class="table-responsive border-bottom mb-2">
<table class="table table-striped table-sm" id="table-modal-booking-files">
<thead>
<tr>
<th>#</th>
<th>Datei</th>
<th>Inhalt</th>
<th>Datum</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
@php($booking_files_count = 1)
@if($booking->fewo_lodging)
<tr>
<th scope="row">{{$booking_files_count++}}</th>
<td>
<a target="_blank" href="{{ route('customer_file_show', ['fewo_instruction_pdf', $booking->fewo_lodging->id, 'stream']) }}" class="badge badge-md badge-next">
<i class="fa fa-file-pdf mr-1"></i> {{\App\Services\BookingFewo::getFeWoInstructionPDFName($booking->fewo_lodging)}}
</a>
</td>
<td>
application/pdf
</td>
<td>-</td>
<td>
<button data-target="{{ route('customer_file_show', ['fewo_instruction_pdf', $booking->fewo_lodging->id, 'stream']) }}" data-name="{{\App\Services\BookingFewo::getFeWoInstructionPDFName($booking->fewo_lodging)}}" 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
@foreach(\App\Services\BookingFewo::contentFiles() as $content_file)
@if($file = \App\Models\CMSContent::getModelBySlug($content_file))
<tr>
<th scope="row">{{$booking_files_count++}}</th>
<td>
<a target="_blank" href="{{ $file->getURL() }}" class="badge badge-md badge-next">
<i class="fa fa-file-pdf mr-1"></i> {{$file->name}}
</a>
</td>
<td>
{{ $file->formatBytes() }}
</td>
<td>{{\App\Services\Util::_format_date($file->created_at, 'date')}}</td>
<td>
<button data-target="{{ $file->getURL() }}" data-name="{{ $file->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>
@endif
@endforeach
@if($booking->booking_files)
@foreach($booking->booking_files as $booking_file)
<tr>
<th scope="row">{{$booking_files_count++}}</th>
<td>
<a target="_blank" href="{{ $booking_file->getURL() }}" class="badge badge-md badge-secondary">
<i class="{{$booking_file->getIconExt()}} mr-1"></i> {{ $booking_file->original_name }}
</a>
</td>
<td>
{{ $booking_file->mine }} | {{ $booking_file->formatBytes() }}
</td>
<td>{{\App\Services\Util::_format_date($booking_file->created_at, 'date')}}</td>
<td>
<button data-target="{{ $booking_file->getURL() }}" data-name="{{ $booking_file->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
</tbody>
</table>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#table-modal-booking-files [rel="tooltip"]').tooltip({trigger: "hover"});
$('#table-modal-booking-files .add-file-to-attachment').on('click', function (event) {
var $elem = $('<div/>');
$elem.data('action', 'add_attachment');
$elem.data('id', 'new');
$elem.data('url', '{{route('customer_fewo_mail_ajax')}}');
$elem.data('target', $(this).data('target'));
$elem.data('name', $(this).data('name'));
ajax_object_action(event, $elem, callback_ajax_add_attachment);
});
});
</script>

View file

@ -0,0 +1,78 @@
<div class="table-responsive border-bottom mb-2">
<table class="table table-striped table-sm" id="table-modal-lead-files">
<thead>
<tr>
<th>#</th>
<th>Datei</th>
<th>Inhalt</th>
<th>Datum</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
@php($lead_files_count = 1)
@foreach(\App\Services\Lead::contentFiles() as $content_file)
@if($file = \App\Models\CMSContent::getModelBySlug($content_file))
<tr>
<th scope="row">{{$lead_files_count++}}</th>
<td>
<a target="_blank" href="{{ $file->getURL() }}" class="badge badge-md badge-next">
<i class="fa fa-file-pdf mr-1"></i> {{$file->name}}
</a>
</td>
<td>
{{ $file->formatBytes() }}
</td>
<td>{{\App\Services\Util::_format_date($file->created_at, 'date')}}</td>
<td>
<button data-target="{{ $file->getURL() }}" data-name="{{ $file->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>
@endif
@endforeach
@if($lead->lead_files)
@foreach($lead->lead_files as $lead_file)
<tr>
<th scope="row">{{$lead_files_count++}}</th>
<td>
<a target="_blank" href="{{ $lead_file->getURL() }}" class="badge badge-md badge-secondary">
<i class="{{$lead_file->getIconExt()}} mr-1"></i> {{ $lead_file->original_name }}
</a>
</td>
<td>
{{ $lead_file->mine }} | {{ $lead_file->formatBytes() }}
</td>
<td>{{\App\Services\Util::_format_date($lead_file->created_at, 'date')}}</td>
<td>
<button data-target="{{ $lead_file->getURL() }}" data-name="{{ $lead_file->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
</tbody>
</table>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#table-modal-lead-files [rel="tooltip"]').tooltip({trigger: "hover"});
$('#table-modal-lead-files .add-file-to-attachment').on('click', function (event) {
var $elem = $('<div/>');
$elem.data('action', 'add_attachment');
$elem.data('id', 'new');
$elem.data('url', '{{route('lead_mail_ajax')}}');
$elem.data('target', $(this).data('target'));
$elem.data('name', $(this).data('name'));
ajax_object_action(event, $elem, callback_ajax_add_attachment);
});
});
</script>

View file

@ -0,0 +1,508 @@
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
{{ $value->title }}
@if($value->subtitle)
<br><small class="text-muted">{{$value->subtitle}}</small>
@endif
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
</div>
<div class="modal-body">
{!! Form::open(['url' => $value->url, 'class' => '', 'id'=>'lead-mail-form']) !!}
{{ Form::hidden('lead_id', $value->id) }}
{{ Form::hidden('action', '') }}
@if(isset($value->save_lead_mail_id))
{{ Form::hidden('save_lead_mail_id', $value->save_lead_mail_id) }}
@endif
@if($value->show === 'single' || $value->show === 'reply')
<div class="row">
@if(isset($value->lead))
<div class="col-sm-4">
<strong>Anfrage: </strong><br>
({{ $value->lead->id }})
</div>
<div class="col-sm-4">
@if($value->lead->customer)
<strong>Kunde: </strong><br>{{ $value->lead->customer->getSalutation() }} {{ $value->lead->customer->title }} {{ $value->lead->customer->firstname }} {{ $value->lead->customer->name }}
({{$value->lead->id}})
@endif
</div>
@endif
<div class="col-sm-4">
@if(isset($value->lead_mail))
<strong>Antwort auf: </strong><br>{{ $value->lead_mail->id }} || {{ $value->lead_mail->subject }}
@endif
</div>
<div class="col-sm-12">
<hr>
</div>
</div>
@endif
@if(isset($value->customers))
@if($value->show === 'single')
<div class="form-row">
<div class="form-group col-sm-12 mb-1">
<label for="to" class="form-label">E-Mail senden an:*</label>
@foreach($value->customers as $key=>$val)
<label class="custom-control custom-checkbox mt-2" style="margin-right: 20px;">
{!! Form::checkbox('send_mail_to['.$key.']', 1, $key, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">
<div class="row">
<div class="col-sm-6">
{{ Form::text('send_mail_to_mail['.$key.']', $val['email'], array('placeholder'=>'Erste E-Mail: Pflichtpfeld', 'id'=>'send_mail_to_mail_'.$key, 'class'=>'form-control', 'style'=>'margin-top: -8px;', 'required')) }}
</div>
<div class="col-sm-6">
<button type="button" class="btn btn-sm btn-outline-primary mt-1 mb-2" data-toggle="collapse" data-target="#collapseModalNewMailRe" aria-expanded="false" aria-controls="collapseModalNewMailRe"><i class="fa fa-plus-circle"></i> Weitere Empfänger</button>
</div>
</div>
</span>
</label>
@endforeach
</div>
</div>
<div class="collapse form-row" id="collapseModalNewMailRe">
<div class="form-group col-sm-4">
<label class="form-label" for="recipient">TO: (weitere Empfänger)</label>
{{ Form::textarea('recipient', $value->recipient, ['class' => 'form-control', 'rows'=>4]) }}
</div>
<div class="form-group col-sm-4">
<label class="form-label" for="cc">CC: (Kopie Empfänger)</label>
{{ Form::textarea('cc', $value->cc, ['class' => 'form-control', 'rows'=>4]) }}
</div>
<div class="form-group col-sm-4">
<label class="form-label" for="bcc">BCC: (Blindkopie Empfänger)</label>
{{ Form::textarea('bcc', $value->bcc, ['class' => 'form-control', 'rows'=>4]) }}
</div>
</div>
@endif
@if($value->show === 'multi')
<div class="form-row">
<div class="form-group col-sm-12 mb-1">
<label for="to" class="form-label">E-Mail senden an:</label>
@foreach($value->customers as $key=>$val)
<label class="custom-control custom-checkbox mt-2" style="margin-right: 20px;">
{!! Form::checkbox('send_mail_to['.$key.']', 1, $key, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">{{ $val['email'] }} | {{ $val['name'] }}</span>
</label>
@endforeach
</div>
</div>
@endif
@endif
@if($value->show === 'reply' && isset($value->lead))
<div class="form-row">
<div class="form-group col">
<label for="mail_from" class="form-label">E-Mail von:</label>
{{ Form::text('mail_from', $value->lead->customer ? $value->lead->customer->email : '', array('placeholder'=>'E-Mail Adresse von', 'id'=>'mail_from', 'class'=>'form-control', 'required')) }}
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label for="sent_at" class="form-label">Gesendet am:</label>
{{ Form::text('sent_at', \Carbon::now()->format('d.m.Y H:i'), array('placeholder'=>__(\Carbon::now()->format('d.m.Y - H:i')), 'class'=>'form-control b-material-datetime-picker', 'id'=>'sent_at')) }}
</div>
</div>
@endif
<div class="form-row">
{{ Form::hidden('lead_title_id', $value->lead_title_id, array('id'=>'lead_title_id')) }}
<div class="form-group col">
<label for="subject" class="form-label">Betreff</label>
{{ 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')
@if(Auth::user()->isPermission('sua-st-em'))
<div class="float-right small">Vorlage unter: <a href="{{route('admin_settings_emails')}}">Einstellungen -> E-Mails / Vorlagen</a></div>
@endif
@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>
<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>
<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>
<span class="ql-formats">
<select class="ql-align"></select>
</span>
<span class="ql-formats">
<button class="ql-clean"></button>
</span>
<span class="ql-formats">
<select class="ql-placeholder">
{!! \App\Services\Placeholder::getBookingOptions() !!}
</select>
</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">
<button type="button" class="btn btn-sm btn-outline-next mt-1 mb-3 float-left" data-toggle="collapse" data-target="#collapseModalEmailTemplate" aria-expanded="false" aria-controls="collapseModalEmailTemplate"><i class="ion ion-ios-mail"></i> E-Mail Vorlage laden</button>
</div>
<div class="collapse col-12" id="collapseModalEmailTemplate">
<hr class="mt-0">
<select class="custom-select" name="filter_email_templates_directory" id="filter_email_templates_directory" style="">
<option value="">Alle Verzeichniss</option>
@foreach($value->filter_email_templates_directories as $id=>$name)
<option value="{{$id}}" >{{$name}}</option>
@endforeach
</select>
<div class="table-responsive" id="email_templates_table">
<table id="datatables-email-templates" class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>{{__('Vorlage Bezeichnung')}}</th>
<th>{{__('Verzeichniss')}}</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody class="">
</tbody>
</table>
</div>
<hr class="mt-1">
</div>
</div>
@endif
@if($value->show === 'single' || $value->show === 'reply')
<div class="form-row">
<div class="col-sm-6">
<label for="send_mail_dir" class="form-label">Ablegen unter:</label>
<select class="custom-select" name="dir" id="send_mail_dir">
@foreach(\App\Services\Lead::getCustomerMailDirs() as $lead_mail_dir)
<option value="{{$lead_mail_dir->pos}}" @if($value->lead_mail_dir == $lead_mail_dir->pos) selected @endif>{{$lead_mail_dir->name}}</option>
@endforeach
</select>
</div>
<div class="col-sm-6">
<label for="subdir" class="form-label">&nbsp;</label>
{{-- TODO load subdirs by pos id --}}
{{-- @if(isset($value->booking))
@foreach(\App\Services\Booking::getCustomerMailDirs() as $lead_mail_dir)
@if($lead_mail_dir->pos > 0)
<select class="custom-select send_mail_subdir" name="subdir" id="send_mail_subdir_{{$lead_mail_dir->pos}}">
<option value="0">keinen Unterordner</option>
@foreach($value->booking->travel_country->getMailDirs($lead_mail_dir->pos) as $mail_dir_id)
@php ($mail_dir_name = \App\Services\Booking::getCustomerMailName($lead_mail_dir, $mail_dir_id))
<option value="{{$mail_dir_id}}" @if($value->customer_mail_subdir == $mail_dir_id) selected @endif>{{$mail_dir_name}}</option>
@endforeach
</select>
@endif
@endforeach
@endif
--}}
</div>
</div>
@endif
@if(isset($value->lead_mail))
{{ Form::hidden('lead_mail_id', $value->lead_mail->id) }}
@endif
<hr>
{!! Form::close() !!}
<div class="row">
<div class="col-12">
@if($value->show === 'single' && isset($value->lead))
<button type="button" class="btn btn-sm btn-outline-primary mt-1 mb-2 float-right" data-toggle="collapse" data-target="#collapseModalLeadFiles" aria-expanded="false" aria-controls="collapseModalLeadFiles"><i class="fa fa-plus-circle"></i> Dateien aus Buchung</button>
@endif
<h5>Datei Anhänge</h5>
</div>
@if($value->show === 'single' && isset($value->lead))
<div class="collapse col-12" id="collapseModalLeadFiles">
@include('lead.modal-new-lead-files', ['lead'=>$value->lead])
</div>
@endif
<div class="col-12">
<div class="alert alert-danger alert-dismissable" style="display:none;"></div>
</div>
<div class="col-6" id="preview-mail-attachment">
@if(isset($value->lead_files))
@foreach($value->lead_files as $lead_file)
<div class="message-attachment ui-bordered p-2 mr-3 mb-3">
<div class="message-attachment-file display-4"><i class="mail-att-icon {{$lead_file->getIconExt()}}"></i></div>
<div class="media-body ml-3">
<strong class="message-attachment-filename">{{$lead_file->original_name}}</strong>
<div class="text-muted small mail-att-size">{{$lead_file->formatBytes()}}</div>
<div>
<a href="{{$lead_file->getURL()}}" target="_blank" class="mail-att-show">Vorschau</a> &nbsp;
<a href="javascript:void(0)" data-url="{{route('lead_mail_ajax')}}" data-id="{{$lead_file->id}}" data-action="delete_mail_attachment" class="mail-att-delete">löschen</a>
</div>
</div>
</div>
@endforeach
@endif
</div>
<div class="col-6">
{!! Form::open([ 'url' => route('lead_mail_upload_attachment', ['tmp']), 'method' => 'post', 'files' => true, 'enctype' => 'multipart/form-data', 'class' => 'dropzone', 'id' => 'uploadAttachmentFile' ]) !!}
<div class="fallback">
<input name="file" type="file" multiple>
</div>
{!! Form::close() !!}
</div>
</div>
@if(isset($value->lead_mail))
<hr>
@include('lead.modal-show-mail-inner', ['lead_mail' => $value->lead_mail])
@endif
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default float-left" data-dismiss="modal">schließen</button>
@if($value->show === 'single' || $value->show === 'multi')
@if($value->draft)
<button type="submit" class="btn btn-next submit-button-form" value="draft"><i class="ion ion-ios-save"></i> Entwurf speichern</button>
@endif
<button type="submit" class="btn btn-primary submit-button-form" value="send"><i class="ion ion-ios-mail-open"></i> E-Mail senden</button>
@endif
@if($value->show === 'reply')
<button type="submit" class="btn btn-primary submit-button-form" value="save"><i class="ion ion-ios-mail-open"></i> Antwort speichern</button>
@endif
</div>
<div class="message-attachment ui-bordered p-2 mr-3 mb-3 d-none" id="mail-attachment-template">
<div class="message-attachment-file display-4"><i class="mail-att-icon"></i></div>
<div class="media-body ml-3">
<strong class="message-attachment-filename"> </strong>
<div class="text-muted small mail-att-size"> </div>
<div>
<a href="javascript:void(0)" target="_blank" class="mail-att-show">Vorschau</a> &nbsp;
<a href="javascript:void(0)" class="mail-att-remove">entfernen</a>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function callback_ajax_add_attachment(response) {
if(response.error === false){
add_mail_attachment_preview(response);
}
}
function add_mail_attachment_preview(response){
console.log(response);
var template = $('#mail-attachment-template').clone()
.removeAttr('id').removeClass('d-none')
.attr('data-id', response.file_id);
template.find('.mail-att-icon').addClass(response.file_icon);
template.find('.message-attachment-filename').text(response.original_name);
template.find('.mail-att-size').text(response.file_format_bytes);
///'storage/file/{id}/{disk}
template.find('.mail-att-show').attr('href', response.file_url);
template.find('.mail-att-remove').on('click', function () {
$(this).parents('.message-attachment').remove();
});
$('#preview-mail-attachment').append(template);
}
function change_mail_subdir_select(){
var $dir_id = $('#send_mail_dir').val();
$('.send_mail_subdir').each(function () {
var send_mail_subdir = 'send_mail_subdir_' + $dir_id;
if($(this).attr('id') === send_mail_subdir){
$(this).prop('disabled', false);
$(this).show();
}else{
$(this).prop('disabled', true);
$(this).val(0);
$(this).hide();
}
})
}
$(document).ready(function() {
change_mail_subdir_select();
$('#send_mail_dir').on('change', function () {
change_mail_subdir_select();
});
if (!window.Quill) {
$('#message-editor,#message-editor-toolbar').remove();
$('#message-editor-fallback').removeClass('d-none');
} else {
Quill.register('modules/placeholder', PlaceholderModule.default(Quill))
//$('#message-editor-fallback').remove();
var quill = new Quill('#message-editor', {
debug: 'error',
modules: {
toolbar: '#message-editor-toolbar',
placeholder: {
placeholders: [
{!! \App\Services\Placeholder::getBookingQuill() !!}
]
}
},
placeholder: '{{$value->m_placeholder}}',
theme: 'snow'
});
}
$('.b-material-datetime-picker').bootstrapMaterialDatePicker({
weekStart: 1,
format : 'DD.MM.YYYY HH:mm',
shortTime: false,
nowButton : true,
clearButton: true,
lang: 'de',
//currentDate: ''
});
$(".submit-button-form").click(function(event) {
@if(isset($value->customers))
if($(this).val() === 'send' && !confirm('E-Mail wirklich senden?')){
event.preventDefault();
return;
}
@endif
$('#lead-mail-form input[name=action]').val($(this).val());
$("#message-editor-fallback").val($('#message-editor .ql-editor').html());
var message_attachment = $('#preview-mail-attachment').find('.message-attachment');
$.each( message_attachment, function( index, value ){
$('#lead-mail-form').append('<input type="hidden" name="message_attachment_id[]" value="'+$(value).data('id')+'">');
});
$( "#lead-mail-form" ).submit();
});
$("#preview-mail-attachment .mail-att-delete").click(function(event) {
_self = $(this);
if(!confirm('Angang wirklick löschen?')){
event.preventDefault();
return;
}
ajax_object_action(event, $(this), function (data) {
console.log(data);
if(data.status === 'success'){
_self.parents('.message-attachment').remove();
}
});
});
var emailTempplateTable = $('#datatables-email-templates').DataTable({
"processing": true,
"serverSide": true,
"searching": true,
"autoWidth": false,
ajax: {
url: '{!! route( 'email_template_data_table' ) !!}',
data: function(d) {
d.filter_email_templates_directory = $('select[name=filter_email_templates_directory]').val();
}
},
"columns": [
{ data: 'id', width: '8%', searchable: true },
{ data: 'name', name: 'name', width: '', searchable: true },
{ data: 'email_template_dir.name', name: 'email_template_dir.name', width: '25%', orderable: false, searchable: false },
{ data: 'action', width: '8%', orderable: false, searchable: false},
],
"bLengthChange": false,
"iDisplayLength": 10,
"orderSequence": ["desc", "asc"],
"order": [[ 0, "desc" ]],
"language": {
"url": "/js/German.json"
},
"drawCallback": function( settings ) {
$('#datatables-email-templates [rel="tooltip"]').tooltip({trigger: "hover"});
$('#datatables-email-templates .email-template-action').on('click', function (event) {
ajax_object_action(event, $(this), callback_email_template_data_table);
});
}
});
$('#filter_email_templates_directory').on('change', function(){
emailTempplateTable.draw();
});
function callback_email_template_data_table(data) {
if(data.status === 'success'){
if($('input#subject').val() === $('input#lead_title_id').val()){
$('input#subject').val(data.response.subject + $('input#lead_title_id').val());
}
$("input#message-editor-fallback").val(data.html);
$('#message-editor .ql-editor').html(data.html)
$('#collapseModalEmailTemplate').collapse('hide');
}
}
Dropzone.autoDiscover = false;
$("#uploadAttachmentFile").dropzone({
uploadMultiple: false,
parallelUploads: 1,
maxFilesize: 32,
addRemoveLinks: true,
dictDefaultMessage: '<i class="ion ion-ios-cloud-upload "></i>Hier klicken, oder Datei hier reinziehen (Drag&Drop)',
dictFallbackMessage: 'Ihr Browser unterstützt Drag&Drop Dateiuploads nicht',
dictFallbackText: 'Benutzen Sie das Formular um Ihre Dateien hochzuladen',
dictFileTooBig: "Die Datei ist zu groß. Die maximale Dateigröße beträgt 32 MB",
dictInvalidFileType: 'Eine Datei dieses Typs kann nicht hochgeladen werden',
dictResponseError: "Der Server hat ihre Anfrage mit Status error abgelehnt",
dictCancelUpload: 'Hochladen abbrechen',
dictCancelUploadConfirmation: null,
dictRemoveFile: 'Datei entfernen',
dictMaxFilesExceeded: 'Sie können keine weiteren Dateien mehr hochladen',
acceptedFiles: "image/jpeg,image/pjpeg,image/png,image/gif,application/pdf,text/plain",
// The setting up of the dropzone
init:function() {
this.on("removedfile", function(file) {
var _ele = $('.alert-danger');
_ele.fadeOut();
});
this.on("addedfile", function (file) {
var _ele = $('.alert-danger');
_ele.fadeOut();
});
},
error: function(file, response) {
var message
if($.type(response) === "string")
message = response; //dropzone sends it's own error messages in string
else
message = response.message;
var _ele = $('.alert-danger');
_ele.fadeIn();
console.log(message);
_ele.text(message);
},
success: function(file,response) {
// console.log(file);
// console.log(response);
if(response.error === false){
add_mail_attachment_preview(response);
this.removeFile(file);
}
}
});
});
</script>

View file

@ -0,0 +1,142 @@
<div class="card mb-2">
<!-- Header -->
<div class="media px-4 pt-4 pb-2">
<a href="javascript:void(0)" class="messages-sidebox-toggler d-lg-none d-block align-self-center text-muted text-large pr-3 mr-3"><i class="ion ion-md-more"></i></a>
<!-- Sender photo -->
<div class="media-body">
<!-- Sender & date -->
<div class="mb-1">
@if($lead_mail->is_answer)
Antwort von:<br>
@else
Gesendet an:<br>
@endif
&lt;<a href="mailto:{{$lead_mail->email}}">{{$lead_mail->email}}</a>&gt; {{$lead_mail->sent_at }}
@if($lead_mail->recipient)
<div>TO: {{\App\Services\Util::_implodeLines($lead_mail->recipient, ', ')}}</div>
@endif
@if($lead_mail->cc)
<div>CC: {{\App\Services\Util::_implodeLines($lead_mail->cc, ', ')}}</div>
@endif
@if($lead_mail->bcc)
<div>BCC: {{\App\Services\Util::_implodeLines($lead_mail->bcc, ', ')}}</div>
@endif
</div>
<!-- Subject -->
<h5 class="line-height-inherit m-0">{{$lead_mail->subject}}</h5>
</div>
</div>
<hr class="border-light m-0">
<div class="p-4">
{!! nl2br($lead_mail->message) !!}
</div>
<hr class="border-light m-0">
<!-- Message infos -->
<div class="px-4 pt-4 pb-2">
@if($lead_mail->customer)
<p><strong>Kunde: </strong>
{{ $lead_mail->customer->getSalutation() }} {{ $lead_mail->customer->title }} {{ $lead_mail->customer->firstname }} {{ $lead_mail->customer->name }}
@if($lead_mail->lead)
({{$lead_mail->lead->id}})
@endif
</p>
@endif
@if($lead_mail->lead)
<p><strong>Anfrage: </strong>
({{ $lead_mail->lead_id }})
</p>
@endif
@if($lead_mail->send)
<span class="badge badge-success">Mail gesendet</span>
<p>Datum: {{$lead_mail->sent_at}}</p>
@endif
@if($lead_mail->fail)
<span class="badge badge-danger">Mail Fehler</span>
<p>{{$lead_mail->error }}</p>
@endif
</div>
<!-- Message attachments -->
@if($lead_mail->lead_files)
<hr class="border-light m-0">
<div class="px-4 pt-4 pb-2">
<h6 class="small font-weight-semibold mb-4">Datei-Anhänge</h6>
<div class="row">
@foreach($lead_mail->lead_files as $file)
<div class="col-sm-12 col-md-6 col-xl-4">
<div class="message-attachment ui-bordered p-2 mr-3 mb-3">
<div class="message-attachment-file display-4"><i class="{{$file->getIconExt()}}"></i></div>
<div class="media-body ml-3">
<strong class="message-attachment-filename">{{$file->original_name}}</strong>
<div class="text-muted small">{{$file->formatBytes()}}</div>
<div>
<a href="{{$file->getURL()}}" target="_blank" class="mail-att-show">Vorschau</a> &nbsp;
</div>
</div>
</div>
</div>
@endforeach
</div>
</div>
@endif
@if(isset($show_move_dirs) && $show_move_dirs)
<hr class="border-light m-0">
<div class="px-4 pt-4 pb-2">
{!! Form::open(['url' => route('lead_mail_detail', [$lead_mail->id, 'move-mail-lead']), 'class' => 'move-mail-form']) !!}
<div class="form-row">
<div class="col-sm-6">
<label for="lead_mail_dir" class="form-label">Ablegen unter:</label>
<select class="custom-select lead_mail_dir" name="dir" id="lead_mail_dir">
@foreach(\App\Services\Lead::getCustomerMailDirs() as $lead_mail_dir)
<option value="{{$lead_mail_dir->pos}}" @if($lead_mail->dir == $lead_mail_dir->pos) selected @endif>{{$lead_mail_dir->name}}</option>
@endforeach
</select>
</div>
<div class="col-sm-6">
<button type="submit" class="btn btn-xs btn-default float-right mt-1"><i class="ion ion-ios-redo"></i>&nbsp; verschieben</button>
<label for="subdir" class="form-label">&nbsp;</label>
{{-- TODO load subdirs by pos id
@if($lead_mail->booking->travel_country)
@foreach(\App\Services\Booking::getCustomerMailDirs() as $lead_mail_dir)
@if($lead_mail_dir->pos > 0)
<select class="custom-select lead_mail_subdir" name="subdir" id="lead_mail_subdir_{{$lead_mail_dir->pos}}">
<option value="0">keinen Unterordner</option>
@foreach($lead_mail->booking->travel_country->getMailDirs($lead_mail_dir->pos) as $mail_dir_id)
@php ($mail_dir_name = \App\Services\Booking::getCustomerMailName($lead_mail_dir, $mail_dir_id))
<option value="{{$mail_dir_id}}" @if($lead_mail->subdir == $mail_dir_id) selected @endif>{{$mail_dir_name}}</option>
@endforeach
</select>
@endif
@endforeach
@endif
--}}
</div>
</div>
{!! Form::close() !!}
<hr>
{!! Form::open(['url' => route('lead_mail_detail', [$lead_mail->id, 'forward-mail-lead']), 'class' => 'forward-mail-form']) !!}
<div class="form-row">
<div class="col-sm-6">
<label for="lead_mail_forward_email" class="form-label">E-Mail weiterleiten:</label>
{{ Form::text('lead_mail_forward_email', $lead_mail->email, array('placeholder'=>'E-Mail', 'id'=>'lead_mail_forward_email', 'class'=>'form-control', 'required')) }}
</div>
<div class="col-sm-6">
<button type="submit" class="btn btn-xs btn-default float-right mt-1" onclick="return confirm('{{__('Wirklich weiterleiten? E-Mail wird erneut gesendet!')}}');"><i class="ion ion-ios-send"></i>&nbsp; weiterleiten</button>
</div>
</div>
{!! Form::close() !!}
</div>
@endif
</div>
@if(isset($lead_mail->lead_mail))
<hr>
@include('lead.modal-show-mail-inner', ['lead_mail' => $lead_mail->lead_mail, 'show_move_dirs' => false])
@endif

View file

@ -0,0 +1,50 @@
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
{{ $value->title }}
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
</div>
<div class="modal-body">
@include('lead.modal-show-mail-inner', ['lead_mail' => $lead_mail, 'show_move_dirs' => true])
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">schließen</button>
</div>
</div>
<script type="text/javascript">
function change_mail_subdir_select(_form){
var $dir_id = _form.find('#lead_mail_dir').val();
$('.lead_mail_subdir').each(function () {
var lead_mail_subdir = 'lead_mail_subdir_' + $dir_id;
if($(this).attr('id') === lead_mail_subdir){
$(this).prop('disabled', false);
$(this).show();
}else{
$(this).prop('disabled', true);
$(this).val(0);
$(this).hide();
}
})
}
$(document).ready(function() {
$('form.move-mail-form').each(function () {
var _form = $(this);
$(this).find('.lead_mail_dir').on('change', function () {
change_mail_subdir_select(_form);
_form.find('.btn-default').removeClass('btn-default').addClass('btn-primary');
});
$(this).find('.lead_mail_subdir').on('change', function () {
_form.find('.btn-default').removeClass('btn-default').addClass('btn-primary');
});
change_mail_subdir_select(_form);
});
});
</script>

View file

@ -73,6 +73,7 @@
</a>
@endforeach
@foreach($travel_user_booking_fewo::$customer_mail_dirs as $dir_id => $customer_mail_dir)
@php($badge = "badge-outline-primary")
<a href="javascript:void(0)" class="d-flex justify-content-between align-items-center py-2 px-4 sidebox-nav-item"
data-dir="{{$dir_id}}" data-subdir="0" data-icon="{{$customer_mail_dir['icon']}}" data-name="{{$customer_mail_dir['name']}}">
<div class="item">

View file

@ -41,7 +41,7 @@
<div class="card-datatable table-responsive py-2">
<input type="hidden" name="sort_travel_country_id" value="">
<input type="hidden" name="sort_travelagenda_id" value="">
<table id="datatables-default" class="table table-striped table-bordered">
<table id="datatables-fewos" class="table table-striped table-bordered">
<thead>
<tr>
<th style="max-width: 10px;">&nbsp;</th>
@ -52,6 +52,7 @@
<th>{{__('bis')}}</th>
<th>{{__('Eingetragen')}}</th>
<th>{{__('Mails')}}</th>
<th>{{__('N.')}}</th>
<th>{{__('Kanal')}}</th>
<th>{{__('Datum')}}</th>
<th>{{__('R.-Nr.')}}</th>
@ -67,7 +68,7 @@
<script>
$( document ).ready(function() {
var table =$('#datatables-default').DataTable({
var table =$('#datatables-fewos').DataTable({
"processing": true,
"serverSide": true,
"searching": true,
@ -87,6 +88,7 @@
{ data: 'to_date', name: 'to_date' },
{ data: 'is_calendar', name: 'is_calendar', orderable: false },
{ data: 'is_mail', name: 'is_mail', orderable: false },
{ data: 'booking_fewo_notice', name: 'booking_fewo_notice', orderable: false },
{ data: 'travel_booking_fewo_channel.name', name: 'travel_booking_fewo_channel.name' },
{ data: 'booking_date', name: 'booking_date' },
{ data: 'invoice_number', name: 'invoice_number' },
@ -97,6 +99,10 @@
"iDisplayLength": 50,
"language": {
"url": "/js/German.json"
},
drawCallback: function () {
$('#datatables-fewos [rel="tooltip"]').tooltip({trigger: "hover"});
$('#datatables-fewos [data-toggle="popover"]').popover({trigger: "hover", content: get_popover_content, html: true,});
}
});
$('#option_fewo_id').on('change', function(){
@ -105,7 +111,38 @@
$('#option_channel_id').on('change', function(){
table.draw();
});
$('#datatables-default').tooltip({selector: '[data-toggle="tooltip"]'});
$('#datatables-fewos').tooltip({selector: '[data-toggle="tooltip"]'});
function get_popover_content() {
if ($(this).data('travel_user_booking_fewo_id')) {
var data = {};
data['action'] = $(this).data('action');
data['travel_user_booking_fewo_id'] = $(this).data('travel_user_booking_fewo_id');
$(this).addClass("loading");
var icontent = $.ajax({
url: '{!! route( 'travel_user_booking_fewo_ajax_requests' ) !!}',
data: data,
type: "POST",
dataType: "html",
cache: false,
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
encode: true,
async: false,
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function() {
// just get the response
},
error: function() {
// nothing
}
}).responseText;
$(this).removeClass("loading");
return icontent;
}
return "Keine Buchungs-ID";
}
});
</script>

View file

@ -30,26 +30,7 @@
</div>
</div>
<hr class="border-light m-0">
<!-- / Header -->
{{-- <!-- Controls -->
<div class="media flex-wrap align-items-center p-2">
<div class="media-body d-flex flex-wrap flex-basis-100 flex-basis-sm-auto">
<button type="button" class="btn btn-default borderless md-btn-flat icon-btn messages-tooltip text-muted mr-3" title="Back"><i class="ion ion-md-arrow-back"></i></button>
<button type="button" class="btn btn-default borderless md-btn-flat icon-btn messages-tooltip text-muted" title="Mark as unread"><i class="ion ion-md-mail-unread"></i></button>
<button type="button" class="btn btn-default borderless md-btn-flat icon-btn messages-tooltip text-muted" title="Mark as important"><i class="ion ion-md-alert"></i></button>
<button type="button" class="btn btn-default borderless md-btn-flat icon-btn messages-tooltip text-muted" title="Move to spam"><i class="ion ion-md-folder-open"></i></button>
<button type="button" class="btn btn-default borderless md-btn-flat icon-btn messages-tooltip text-muted" title="Move to trash"><i class="ion ion-md-trash"></i></button>
</div>
<div class="d-flex flex-wrap align-items-center ml-auto">
<button type="button" class="btn btn-default borderless md-btn-flat text-muted px-3"><i class="ion ion-ios-undo"></i>&nbsp; Reply</button>
<div class="text-lighter">|</div>
<button type="button" class="btn btn-default borderless md-btn-flat text-muted px-3">Forward &nbsp;<i class="ion ion-ios-redo"></i></button>
</div>
</div>
<hr class="border-light m-0">
<!-- / Controls -->
--}}
<div class="p-4">
{!! nl2br($customer_mail->message) !!}
</div>
@ -61,7 +42,7 @@
<p><strong>Kunde: </strong>
{{ $customer_mail->customer->getSalutation() }} {{ $customer_mail->customer->title }} {{ $customer_mail->customer->firstname }} {{ $customer_mail->customer->name }}
@if($customer_mail->booking)
({{$customer_mail->booking->id}})1
({{$customer_mail->booking->id}})
@endif
</p>
@endif
@ -149,7 +130,7 @@
</div>
<div class="col-sm-6">
<button type="submit" class="btn btn-xs btn-default float-right mt-1" onclick="return confirm('{{__('Wirklich weiterleiten? E-Mail wird erneut gesendet!')}}');"><i class="ion ion-ios-send"></i>&nbsp; weiterleiten</button>
</div
</div>
</div>
{!! Form::close() !!}
</div>