Edit / PDF / Mail / ->Leads

This commit is contained in:
Kevin Adametz 2021-05-07 17:44:02 +02:00
parent 5d55e5be3f
commit 66ca252bfa
43 changed files with 2915 additions and 76 deletions

View file

@ -556,6 +556,172 @@
>Neue Datei anlegen</button>
</div>
</div>
<!-- Lead Anfragen -->
<h4 class="mt-4 mb-2 ml-4">Ordner für Anfragen/E-Mail Ablage</h4>
<div class="card-datatable table-responsive pt-0">
<table class="datatables-customer-lead-mail-dirs table table-striped table-bordered">
<thead>
<tr>
<th style="max-width: 60px;">&nbsp;</th>
<th style="width: 2%;">{{__('ID')}}</th>
<th>{{__('Name')}}</th>
<th>{{__('Icon')}}</th>
<th>{{__('Model')}}</th>
<th>{{__('E-Mails')}}</th>
</tr>
</thead>
<tbody>
@php($next_customer_lead_mail_dir_id = 0)
@foreach($customer_lead_mail_dirs as $customer_lead_mail_dir)
<tr>
<td class="not">
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#modals-customer-lead-mail-dirs"
data-id="{{$customer_lead_mail_dir->id}}"
data-icon="{{$customer_lead_mail_dir->getArrayContent('icon')}}"
data-model="{{$customer_lead_mail_dir->getArrayContent('model')}}"
data-emails="{{\App\Services\Util::_implodeLines($customer_lead_mail_dir->getArrayContent('emails'))}}"
data-name="{{$customer_lead_mail_dir->name}}"
data-pos="{{$customer_lead_mail_dir->pos}}">
<span class="fa fa-edit"></span>
</button>
</td>
<td>{{ $customer_lead_mail_dir->pos }}</td>
<td>{{ $customer_lead_mail_dir->name }}</td>
<td>{{ $customer_lead_mail_dir->getArrayContent('icon') }}</td>
<td>{{ $customer_lead_mail_dir->getArrayContent('model') }}</td>
<td>
{!! \App\Services\Util::_implodeLines( $customer_lead_mail_dir->getArrayContent('emails'), "<br>") !!}
</td>
{{-- <td><a class="text-danger" href="" onclick="return confirm('{{__('Wirklich löschen?')}}');"><i class="fa fa-trash-alt"></i></a></td> --}}
</tr>
@php($next_customer_lead_mail_dir_id = $customer_lead_mail_dir->pos+1)
@endforeach
</tbody>
</table>
<div class="mt-4 ml-3 text-left">
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#modals-customer-lead-mail-dirs"
data-id="new"
data-icon=""
data-model=""
data-emails=""
data-name=""
data-pos="{{$next_customer_lead_mail_dir_id}}"
>Neuen Ordner anlegen</button>
</div>
</div>
<!-- Modal template -->
<div class="modal fade" id="modals-customer-lead-mail-dirs">
<div class="modal-dialog">
<form class="modal-content" action="{{ route('admin_settings_emails_update') }}" method="post">
@csrf
<input type="hidden" class="form-control" name="id">
<input type="hidden" class="form-control" name="action" value="customer_mail_dirs">
<input type="hidden" class="form-control" name="step" value="settings">
<input type="hidden" class="form-control" name="identifier" value="customer-lead-mail-dirs">
<input type="hidden" class="form-control" name="field" value="array">
<div class="modal-header">
<h5 class="modal-title">E-Mail Ordner <span class="font-weight-light">anlegen/bearbeiten</span></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
</div>
<div class="modal-body">
<div class="form-row">
<div class="form-group col">
<label for="pos" class="form-label">ID*</label>
<input type="text" class="form-control" name="pos" placeholder="{{__('ID')}}" required>
<em>Die ID definiert die Zuweisung der E-Mails in die jeweiligen Ordner, bei Änderungen der ID können schon zugeordnete E-Mails nicht mehr angezeigt werden.</em>
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label for="name" class="form-label">Name*</label>
<input type="text" class="form-control" name="name" placeholder="{{__('Description')}}" required>
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label for="icon" class="form-label">Icon*</label>
<input type="text" class="form-control" name="icon" placeholder="{{__('Icon')}}" required>
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label for="model" class="form-label">Model <span class="text-muted">(wird benötigt um Unterordner unter Reiseländer zuzuweisen)</span></label>
<input type="text" class="form-control" name="model" placeholder="{{__('Model')}}">
<em>Das Model das muss vorab in der Programmierung erfasst werden.</em>
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label class="form-label" for="emails">Für interene Mails <span class="text-muted">(jede E-Mail in eine extra Zeile)</span></label>
<textarea class="form-control" rows="4" name="emails" cols="50"></textarea>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{__('close')}}</button>
<button type="submit" class="btn btn-primary">{{__('save')}}</button>
</div>
</form>
</div>
</div>
<hr>
<h4 class="mt-2 mb-0 ml-4">Allgemeine PDF Dateien für Anfragen/E-Mail-Anhänge</h4>
<div class="card-datatable table-responsive pt-0">
<table class="datatables-lead-email-files table table-striped table-bordered">
<thead>
<tr>
<th style="max-width: 60px;">&nbsp;</th>
<th style="width: 2%;">{{__('POS')}}</th>
<th>{{__('Name')}}</th>
<th>{{__('Slug')}}</th>
<th>{{__('Inhalt')}}</th>
<th>{{__('Type')}}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($lead_email_files as $value)
<tr>
<td class="not">
<button type="button" class="btn icon-btn btn-sm btn-primary" data-toggle="modal" data-target="#modals-load-content"
data-id="{{ $value->id }}"
data-pos="{{ $value->pos }}"
data-identifier="{{$identifier_lead_file}}"
data-model="content"
data-back="{{route('admin_settings_emails', ['settings'])}}"
data-route="{{ route('cms_content_all_load_modal') }}">
<span class="fa fa-edit"></span>
</button>
</td>
<td>{{ $value->pos }}</td>
<td>{{ $value->name }}</td>
<td>{{ $value->slug }}</td>
<td>@if($value->isFile()) {!! $value->getPreviewContent() !!} @else {{ $value->getPreviewContent() }} @endif</td>
<td>{{ $value->getFieldName() }}</td>
<td><a class="text-danger" href="{{ route('cms_content_all_delete', [$value->id]) }}" onclick="return confirm('{{__('Wirklich löschen?')}}');"><i class="fa fa-trash-alt"></i></a></td>
</tr>
@endforeach
</tbody>
</table>
<div class="mt-4 ml-3 text-left">
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#modals-load-content"
data-id="new"
data-identifier="{{$identifier_lead_file}}"
data-field="file"
data-model="content"
data-back="{{route('admin_settings_emails', ['settings'])}}"
data-route="{{ route('cms_content_all_load_modal') }}"
>Neue Datei anlegen</button>
</div>
</div>
<script>
$( document ).ready(function() {
$('.datatables-booking-email-files').dataTable({
@ -590,6 +756,23 @@
"url": "/js/German.json"
}
});
$('.datatables-customer-lead-mail-dirs').dataTable({
"bLengthChange": false,
"iDisplayLength": 50,
"order": [[ 1, "asc" ]],
"language": {
"url": "/js/German.json"
}
});
$('.datatables-lead-email-files').dataTable({
"bLengthChange": false,
"iDisplayLength": 50,
"order": [[ 1, "desc" ]],
"language": {
"url": "/js/German.json"
}
});
$('#modals-customer-mail-dirs').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget);
@ -610,6 +793,16 @@
$(this).find(".modal-body input[name='model']").val(button.data('model'));
$(this).find(".modal-body textarea[name='emails']").val(button.data('emails'));
});
$('#modals-customer-lead-mail-dirs').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget);
$(this).find(".modal-content input[name='id']").val(button.data('id'));
$(this).find(".modal-body input[name='name']").val(button.data('name'));
$(this).find(".modal-body input[name='pos']").val(button.data('pos'));
$(this).find(".modal-body input[name='icon']").val(button.data('icon'));
$(this).find(".modal-body input[name='model']").val(button.data('model'));
$(this).find(".modal-body textarea[name='emails']").val(button.data('emails'));
});
});
</script>
</div>

View file

@ -33,7 +33,7 @@
</div>
<div class="form-row">
<div class="form-group col-sm-12">
<label for="percentage" class="form-label">Type</label>
<label for="type" class="form-label">Type</label>
{{ Form::select('type', \App\Models\ServiceProvider::$types , $model->type, array('class'=>'custom-select', 'required'=>true)) }}
</div>
</div>