Mail Weiterleitung / verlauf / Notizen Buchnungen

This commit is contained in:
Kevin Adametz 2021-03-31 17:55:02 +02:00
parent f1a1baa913
commit 644ec93c53
47 changed files with 663 additions and 59 deletions

View file

@ -207,7 +207,7 @@
</tr>
@endif
@endforeach
@if($booking->travel_country)
@foreach($booking->travel_country->getContactLandsModels() as $TravelCountry)
@if($TravelCountry->stern_travel_country)
@foreach($TravelCountry->stern_travel_country->general_files as $general_files)
@ -235,13 +235,13 @@
@endforeach
@endif
@endforeach
@endif
@foreach($booking->getPassolutionPDF() as $PassolutionPDF)
@if($PassolutionPDF)
<tr>
<th scope="row">{{$booking_files_count++}}</th>
<td>
<a target="_blank" href="{{ $PassolutionPDF['url'] }}" class="badge badge-md badge-next">
<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>
@ -251,7 +251,7 @@
</td>
<td>{{\App\Services\Util::_format_date($PassolutionPDF['date'], 'date')}}</td>
<td>
<a href="{{ $PassolutionPDF['url'] }}" class="btn btn-xs btn-default"
<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>
@ -297,6 +297,11 @@
@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>
</div>
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal"
data-target="#modals-load-content"
data-id="new-file"

View file

@ -71,6 +71,7 @@
</div>
<div class="badge {{$badge}}">{{$booking->countCustomerMailsBy($customer_mail_dir->pos)}}</div>
</a>
@if($booking->travel_country)
@foreach($booking->travel_country->getMailDirs($customer_mail_dir->pos) as $mail_dir_id)
@php ($mail_dir_name = \App\Services\Booking::getCustomerMailName($customer_mail_dir, $mail_dir_id))
<a href="javascript:void(0)" class="d-flex justify-content-between align-items-center py-1 px-4 sidebox-nav-item sidebox-nav-item_sub"
@ -81,6 +82,7 @@
<div class="badge {{$badge}}">{{$booking->countCustomerMailsBy($customer_mail_dir->pos, $mail_dir_id)}}</div>
</a>
@endforeach
@endif
@endforeach
@foreach($booking::$customer_mail_dirs as $dir_id => $customer_mail_dir)
<a href="javascript:void(0)" class="d-flex justify-content-between align-items-center py-2 px-4 sidebox-nav-item"

View file

@ -0,0 +1,46 @@
<div class="card mb-2">
<h6 class="card-header bg-primary text-white py-2" data-toggle="collapse" data-target="#collapseBookingNotice" aria-expanded="false" aria-controls="collapseBookingNotice">
<strong style="line-height: 1.6em">Notizen</strong>
</h6>
<div class="collapse" id="collapseBookingNotice">
<div class="card-body row">
<div class="col-sm-12">
{!! Form::open(['url' => route('booking_detail', [$id]), 'class' => 'form-horizontal']) !!}
<input type="hidden" name="action" value="save_notice">
<div class="form-group">
{{ Form::textarea('booking_notice', '', array('placeholder'=>__('Neue Notiz hinzufügen …'), 'class'=>'form-control autoExpand', 'id'=>'booking_notice', 'rows'=>'1', 'data-min-rows'=>'1', 'required')) }}
</div>
<div class="form-group text-right">
<button type="submit" class="btn btn-sm btn-primary" ><i class="ion ion-ios-send"></i>&nbsp;Notiz hinzufügen</button>
<hr>
</div>
{!! Form::close() !!}
</div>
@if($booking->booking_notices)
@foreach($booking->booking_notices as $booking_notice)
<div class="col-sm-12">
@if($booking_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">{{ $booking_notice->getName() }} | {{ $booking_notice->created_at->format("d.m.Y - H:i:s") }}</div>
{!! nl2br($booking_notice->message) !!}
</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 | {{ $booking_notice->created_at->format("d.m.Y H:i:s") }}</div>
{!! nl2br($booking_notice->message) !!}
</div>
</div>
--}}
@endforeach
@endif
</div>
</div>
</div>

View file

@ -9,6 +9,7 @@
<div class="col-md-4 col-sm-12">
<h5 class="card-title mt-3 mb-1">Agentur</h5>
<hr class="mt-0 mb-0">
@if($booking->travel_country)
@foreach($booking->travel_country->getContactLandsModels() as $TravelCountry)
@if($TravelCountry->stern_travel_country->count())
<h6 class="pt-2 pb-2 mb-0">{{$TravelCountry->stern_travel_country->name}}</h6>
@ -27,6 +28,7 @@
@endforeach
@endif
@endforeach
@endif
</div>
<div class="col-md-4 col-sm-12">
<h5 class="card-title mt-3 mb-1">Leistungsträger</h5>

View file

@ -95,6 +95,11 @@
PDF Dateien
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="javascript:void(0)" data-collapse="#collapseBookingNotice">
Notizen
</a>
</li>
</ul>
@ -137,6 +142,8 @@
@include('booking._detail_files')
@include('booking._detail_notice')
<div class="float-right mt-3">
<a href="{{route('requests')}}" class="btn btn-sm btn-default">{{ __('zur Übersicht') }}</a>
<a href="{{ make_old_url('/index.php/booking/'.$booking->id.'/edit') }}" class="btn btn-sm btn-default float-right">{{ __('zurück ins CRM v2') }}</a>

View file

@ -48,7 +48,7 @@
{ data: 'booking_id', name: 'booking_id' },
{ data: 'booking', name: 'booking', searchable: false },
{ data: 'send', name: 'send', searchable: false },
{ data: 'created_at', name: 'created_at' },
{ data: 'date', name: 'date' },
],
"bLengthChange": false,

View file

@ -176,6 +176,7 @@
</tr>
@endif
@endforeach
@if($booking->travel_country)
@foreach($booking->travel_country->getContactLandsModels() as $TravelCountry)
@if($TravelCountry->stern_travel_country)
@foreach($TravelCountry->stern_travel_country->general_files as $general_files)
@ -200,6 +201,7 @@
@endforeach
@endif
@endforeach
@endif
@foreach($booking->getPassolutionPDF() as $PassolutionPDF)
@if($PassolutionPDF)

View file

@ -33,7 +33,7 @@
</div>
<div class="col-sm-4">
@if($value->booking->customer)
<strong>Kunde: </strong><br>{{ $value->booking->customer->salutation->name }} {{ $value->booking->customer->title }} {{ $value->booking->customer->firstname }} {{ $value->booking->customer->name }}
<strong>Kunde: </strong><br>@if($value->booking->customer->salutation) {{ $value->booking->customer->salutation->name }} @endif {{ $value->booking->customer->title }} {{ $value->booking->customer->firstname }} {{ $value->booking->customer->name }}
@endif
@if($value->booking->lead)
({{$value->booking->lead->id}})
@ -219,10 +219,10 @@
@if($customer_mail_dir->pos > 0)
<select class="custom-select send_mail_subdir" name="subdir" id="send_mail_subdir_{{$customer_mail_dir->pos}}">
<option value="0">keinen Unterordner</option>
@foreach($value->booking->travel_country->getMailDirs($customer_mail_dir->pos) as $mail_dir_id)
@php ($mail_dir_name = \App\Services\Booking::getCustomerMailName($customer_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
@foreach($value->booking->travel_country->getMailDirs($customer_mail_dir->pos) as $mail_dir_id)
@php ($mail_dir_name = \App\Services\Booking::getCustomerMailName($customer_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
@ -317,7 +317,7 @@
}
function add_mail_attachment_preview(response){
console.log(response);
//console.log(response);
var template = $('#mail-attachment-template').clone()
.removeAttr('id').removeClass('d-none')
.attr('data-id', response.file_id);
@ -454,7 +454,9 @@
function callback_email_template_data_table(data) {
if(data.status === 'success'){
$('input#subject').val(data.response.subject + $('input#lead_title_id').val());
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');

View file

@ -110,7 +110,7 @@
</div>
</div>
@endif
@if(isset($show_move_dirs))
@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('customer_mail_detail', [$customer_mail->id, 'move-mail']), 'class' => 'move-mail-form']) !!}
@ -125,7 +125,6 @@
</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($customer_mail->booking->travel_country)
@ -144,6 +143,24 @@
</div>
</div>
{!! Form::close() !!}
<hr>
{!! Form::open(['url' => route('customer_mail_detail', [$customer_mail->id, 'forward_email']), 'class' => 'forward-mail-form']) !!}
<div class="form-row">
<div class="col-sm-6">
<label for="customer_mail_forward_email" class="form-label">E-Mail weiterleiten:</label>
{{ Form::text('customer_mail_forward_email', $customer_mail->email, array('placeholder'=>'E-Mail', 'id'=>'customer_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>
</div>
@if(isset($customer_mail->customer_mail))
<hr>
@include('customer.mail.modal-show-mail-inner', ['customer_mail' => $customer_mail->customer_mail, 'show_move_dirs' => false])
@endif

View file

@ -10,9 +10,6 @@
@include('customer.mail.modal-show-mail-inner', ['customer_mail' => $customer_mail, 'show_move_dirs' => true])
@if($customer_mail->customer_mail)
@include('customer.mail.modal-show-mail-inner', ['customer_mail' => $customer_mail->customer_mail])
@endif
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">schließen</button>

View file

@ -202,10 +202,40 @@
@endif
</div>
--}}
{{-- Später need ADMIN!!!! --}}
@if(\Auth::user()->isAdmin())
<div class="card-body mb-2" style="background: #fff; border: 1px solid rgba(24, 28, 33, 0.06);">
<h4>{{__('Notizen') }} Buchnungen <span class=" text-muted">letzten 10</span></h4>
@if($last_booking_notices)
@foreach($last_booking_notices as $booking_notice)
<div class="row">
<div class="col-sm-12">
@if($booking_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">{{ $booking_notice->getName() }} | {{ $booking_notice->created_at->format("d.m.Y - H:i:s") }} |
<a class="btn btn-white btn-xs " href="{{ route('booking_detail', [$booking_notice->booking_id]) }}#collapseBookingNotice">zur Buchnung {{ $booking_notice->booking_id }}</a>
</div>
{!! nl2br($booking_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 | {{ $booking_notice->created_at->format("d.m.Y H:i:s") }}</div>
{!! nl2br($booking_notice->message) !!}
</div>
</div>
--}}
@endforeach
@endif
</div>
@endif
<div class="card-body" style="background: #fff; border: 1px solid rgba(24, 28, 33, 0.06);">
<div class="card-body mb-2" style="background: #fff; border: 1px solid rgba(24, 28, 33, 0.06);">
<h4>{{__('Activities') }}</h4>
@if($user->active == 1)
@ -239,7 +269,7 @@
@if($user->active == 1)
<div class="card-body" style="background: #fff; border: 1px solid rgba(24, 28, 33, 0.06);">
<div class="card-body mb-2" style="background: #fff; border: 1px solid rgba(24, 28, 33, 0.06);">
<h4>{{ __('Einwilligung & Datenschutz') }}</h4>
{!! Form::open(['url' => route('user_data_accepted_form'), 'class' => 'form-horizontal' , 'id'=>'data-privacy-form-validations']) !!}
@ -262,7 +292,7 @@
@endif
<div class="card-body" style="background: #fff; border: 1px solid rgba(24, 28, 33, 0.06);">
<div class="card-body mb-2" style="background: #fff; border: 1px solid rgba(24, 28, 33, 0.06);">
<h4>{{__('Login & Security') }}</h4>
<p>{{__('Sign in with your e-mail:')}} {{ Auth::user()->email }}</p>
@if(!$user->isPasswort())

View file

@ -17,6 +17,7 @@
<th>{{__('KundenID')}}</th>
<th>{{__('Vorname')}}</th>
<th>{{__('Nachname')}}</th>
<th>{{__('E-Mail')}}</th>
<th>{{__('Anfrage-Datum')}}</th>
<th>{{__('Sachbearbeiter')}}</th>
<th>{{__('Status')}}</th>
@ -39,6 +40,7 @@
{ data: 'customer_id', name: 'customer_id' },
{ data: 'customer.firstname', name: 'customer.firstname' },
{ data: 'customer.name', name: 'customer.name' },
{ data: 'customer.email', name: 'customer.email' },
{ data: 'request_date', name: 'request_date' },
{ data: 'sf_guard_user.last_name', name: 'sf_guard_user.last_name', searchable: false },
{ data: 'status.name', name: 'status.name' },

View file

@ -190,6 +190,7 @@
<th>{{__('Abreise')}}</th>
<th>{{__('U.')}}</th>
<th>{{__('L.')}}</th>
<th>{{__('N.')}}</th>
<th>{{__('Sachbearbeiter')}}</th>
<th>{{__('Status')}}</th>
<th>{{__('E-Mail')}}</th>
@ -270,6 +271,7 @@
{ data: 'end_date', name: 'end_date' },
{ data: 'travel_documents', name: 'travel_documents', orderable: false },
{ data: 'booking_services', name: 'booking_services', orderable: false },
{ data: 'booking_notice', name: 'booking_notice', orderable: false },
{ data: 'sf_guard_user_id', name: 'sf_guard_user_id', orderable: false },
{ data: 'lead.status_id', name: 'lead.status_id', orderable: false },
{ data: 'last_customer_email', name: 'last_customer_email', orderable: true },
@ -306,7 +308,7 @@
}
} );
} );*/
this.api().columns(14).every( function () {
this.api().columns(15).every( function () {
var column = this;
var title = $(column.header()).html();
var select = $('<select class="selectpicker"><option value="">'+title+'</option></select>')
@ -402,12 +404,9 @@
function get_popover_content() {
if ($(this).data('booking_id')) {
var data = {};
data['action'] = 'get_popover_booking_services';
data['action'] = $(this).data('action');
data['booking_id'] = $(this).data('booking_id');
$(this).addClass("loading");
var icontent = $.ajax({

View file

@ -15,6 +15,7 @@
<li class="nav-item">
<a class="nav-link @if($step == false) active show @endif" data-toggle="tab" href="#navs-site">Seite</a>
</li>
@if($id > 0)
<li class="nav-item">
<a class="nav-link @if($step === 'form') active show @endif" data-toggle="tab" href="#navs-form">Formular</a>
</li>
@ -33,6 +34,7 @@
<li class="nav-item">
<a class="nav-link @if($step === 'travel') active show @endif" data-toggle="tab" href="#navs-travel">Einreisebestimmungen</a>
</li>
@endif
</ul>
@ -102,7 +104,7 @@
</div>
</div>
</div>
@if($id > 0)
<div class="tab-pane fade @if($step === 'form') active show @endif" id="navs-form">
<div class="card">
<div class="card-body">
@ -133,7 +135,7 @@
<select class="selectpicker" data-style="btn-default" name="contact_lands[]" multiple>
{!! HTMLHelper::getTravelCountriesOptions($model->contact_lands) !!}
</select>
<em>Das Land selbst muss auch hier selbst aufgeführt werden, wenn es angezeicht werden soll. Die Kontaktdaten der definierten Länder (Reiselandes) werden nacheinander am Ende des PDF's (RA, RB, Voucher) eingefügt.</em>
<em>Das Land selbst muss auch hier selbst aufgeführt werden, wenn es angezeicht werden soll. Die Kontaktdaten der definierten Länder (Reiselandes) werden nacheinander am Ende des PDFs (RA, RB, Voucher) eingefügt.</em>
</div>
</div>
<hr>
@ -355,6 +357,7 @@
</div>
</div>
</div>
@endif
</div>
</div>

View file

@ -451,7 +451,9 @@
function callback_email_template_data_table(data) {
if(data.status === 'success'){
$('input#subject').val(data.response.subject + $('input#lead_title_id').val());
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');

View file

@ -105,7 +105,7 @@
</div>
</div>
@endif
@if(isset($show_move_dirs))
@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('customer_mail_detail', [$customer_mail->id, 'move-mail-fewo']), 'class' => 'move-mail-form']) !!}
@ -140,6 +140,23 @@
</div>
</div>
{!! Form::close() !!}
<hr>
{!! Form::open(['url' => route('customer_mail_detail', [$customer_mail->id, 'forward_fewo-email']), 'class' => 'forward-mail-form']) !!}
<div class="form-row">
<div class="col-sm-6">
<label for="customer_mail_forward_email" class="form-label">E-Mail weiterleiten:</label>
{{ Form::text('customer_mail_forward_email', $customer_mail->email, array('placeholder'=>'E-Mail', 'id'=>'customer_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>
</div>
@if(isset($customer_mail->customer_mail))
<hr>
@include('travel.user.booking.mail.modal-show-mail-inner', ['customer_mail' => $customer_mail->customer_mail, 'show_move_dirs' => false])
@endif

View file

@ -10,9 +10,10 @@
@include('travel.user.booking.mail.modal-show-mail-inner', ['customer_mail' => $customer_mail, 'show_move_dirs' => true])
@if($customer_mail->customer_fewo_mail)
{{-- @if($customer_mail->customer_fewo_mail)
@include('travel.user.booking.mail.modal-show-mail-inner', ['customer_fewo_mail' => $customer_mail->customer_mail])
@endif
--}}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">schließen</button>