Sehr #geehrte/r# #Anrede# #Vorname# #Nachname#,
Text ...
"; + $value->subject = $lead_id ; + $value->message = CMSContent::getContentBySlug('mailvorlage'); $value->s_placeholder = "Betreff der E-Mail"; $value->m_placeholder = "Nachricht der E-Mail"; if(isset($data['customer_mail_id']) && $customer_mail = CustomerMail::find($data['customer_mail_id'])){ diff --git a/app/Repositories/FileRepository.php b/app/Repositories/FileRepository.php new file mode 100644 index 0000000..153be94 --- /dev/null +++ b/app/Repositories/FileRepository.php @@ -0,0 +1,108 @@ +rules = [ + 'file' => 'required|mimes:pdf,jpeg,png|max:32768' + ]; + $this->messages = [ + 'file.mimes' => 'Datei ist kein PDF/JPG/PNG Format', + 'file.required' => 'PDF/JPG/PNG-Datei wird benötigt' + ]; + } + + public function _set($name, $value){ + $this->{$name} = $value; + } + + public function uploadFile( $form_data ) + { + $validator = Validator::make($form_data, $this->rules, $this->messages); + + if ($validator->fails()) { + return Response::json([ + 'error' => true, + 'message' => $validator->messages()->first(), + 'code' => 400 + ], 400); + } + $file = $form_data['file']; + + $this->originalName = $file->getClientOriginalName(); + $this->extension = strtolower($file->getClientOriginalExtension()); + $this->mine = $file->getClientMimeType(); + $this->size = $file->getClientSize(); + + + $this->makeFilename(); + //$dir = $this->model->getInvoiceStorageAttDir(); + + $this->store(file_get_contents($file->getRealPath())); + $this->save(); + return $this->response(); + + } + + public function storeFile( $content ) + { + $this->makeFilename(); + $this->store($content); + $this->size = Storage::disk($this->disk)->size($this->dir.$this->allowed_filename); + $this->save(); + return $this->response(); + } + + public function store($content){ + if(!Storage::disk($this->disk)->exists( $this->dir )){ + Storage::disk($this->disk)->makeDirectory($this->dir); //creates directory + } + Storage::disk($this->disk)->put($this->dir.$this->allowed_filename, $content); + } + + public function save(){ + + } + + public function response(){ + return Response::json([ + 'error' => false, + 'filename' => $this->allowed_filename, + 'originalName' => $this->originalName, + 'file_data' => $this->extension, + 'mine' => $this->mine, + 'size' => $this->size, + 'redirect' => '', + 'code' => 200 + ], 200); + } + + private function makeFilename(){ + $originalNameWithoutExt = substr($this->originalName, 0, strlen($this->originalName) - strlen($this->extension) - 1); + $this->filename = Util::sanitize($originalNameWithoutExt, true, false, true); + $this->allowed_filename = uniqid("", true) . '_' . $this->filename.".".$this->extension; + } +} \ No newline at end of file diff --git a/app/Services/CreateCouponPDF.php b/app/Services/CreateCouponPDF.php index b6e5aac..5f51beb 100644 --- a/app/Services/CreateCouponPDF.php +++ b/app/Services/CreateCouponPDF.php @@ -93,7 +93,7 @@ class CreateCouponPDF { $pdf->SetFont('Helvetica', '', 10); $customerName = ($this->coupon->customer && $this->coupon->customer->salutation ? $this->coupon->customer->salutation->name . ' ' : '' ) - . ($this->coupon->customer->title ? $$this->coupon->customer->title . ' ' : '' ) + . ($this->coupon->customer->title ? $this->coupon->customer->title . ' ' : '' ) . $this->coupon->customer->fullName(); $customerStreet = $this->coupon->customer ? $this->coupon->customer->street : ''; $customerRegion = $this->coupon->customer->zip ? $this->coupon->customer->zip." " : ''; diff --git a/app/Services/Util.php b/app/Services/Util.php index 8511ace..e355d28 100644 --- a/app/Services/Util.php +++ b/app/Services/Util.php @@ -93,7 +93,7 @@ class Util $clean = ($anal) ? preg_replace("/[^a-zA-Z0-9]/", "", $clean) : $clean ; if($substr){ - $clean = (strlen($clean) > 33) ? substr($clean,-33) : $clean; + $clean = (strlen($clean) > 33) ? substr($clean,0,33) : $clean; } return ($force_lowercase) ? @@ -172,4 +172,31 @@ class Util $charset = mb_detect_encoding($value, "UTF-8, ISO-8859-1, ISO-8859-15", true); return mb_convert_encoding($value, "Windows-1252", $charset); } + + + public static function getMimeFromHeader($http_response_header){ + $pattern = "/^content-type\s*:\s*(.*)$/i"; + if (($header = array_values(preg_grep($pattern, $http_response_header))) && + (preg_match($pattern, $header[0], $match) !== false)) + { + return $match[1]; + + } + return ""; + } + + public static function getExtensionFromMime($mine){ + $mime_types = [ + 'application/pdf' => 'pdf', + 'image/png' => 'png', + 'image/jpg' => 'jpg', + 'image/jpeg' => 'jpg', + 'text/html; charset=UTF-8' => 'html', + 'text/html' => 'html', + + ]; + return isset($mime_types[$mine]) ? $mime_types[$mine] : ""; + } + + } \ No newline at end of file diff --git a/config/filesystems.php b/config/filesystems.php index d96f81a..4880ad0 100755 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -60,6 +60,12 @@ return [ 'url' => env('APP_URL').'/storage/customer', 'visibility' => 'public', ], + 'booking' => [ + 'driver' => 'local', + 'root' => storage_path('app/booking'), + 'url' => env('APP_URL').'/storage/booking', + 'visibility' => 'public', + ], 'fewo_invoices' => [ 'driver' => 'local', 'root' => storage_path('app/fewo/invoices'), diff --git a/database/migrations/2018_10_29_202123_create_booking_table.php b/database/migrations/2018_10_29_202123_create_booking_table.php index bb274b6..b434022 100644 --- a/database/migrations/2018_10_29_202123_create_booking_table.php +++ b/database/migrations/2018_10_29_202123_create_booking_table.php @@ -58,9 +58,14 @@ class CreateBookingTable extends Migration $table->unsignedBigInteger('airline_id')->nullable(); $table->tinyInteger('refund')->nullable()->default(0); $table->date('refund_date')->nullable(); + $table->date('lawyer_date')->nullable(); $table->tinyInteger('hold')->nullable()->default(0); - $table->tinyInteger('xx_tkt')->nullable()->default(0); + $table->date('xx_tkt_date')->nullable(); + $table->string('filekey', 255)->nullable(); + $table->tinyInteger('is_rail_fly')->nullable()->default(0); + $table->text('notice')->nullable(); + $table->dateTime('updated_at'); $table->dateTime('created_at'); diff --git a/database/migrations/2020_04_16_165023_create_booking_files_table.php b/database/migrations/2020_04_16_165023_create_booking_files_table.php new file mode 100644 index 0000000..4369fd0 --- /dev/null +++ b/database/migrations/2020_04_16_165023_create_booking_files_table.php @@ -0,0 +1,46 @@ +bigIncrements('id'); + + $table->bigInteger('booking_id')->nullable(); + + $table->string('identifier')->index(); + $table->string('filename'); + $table->string('dir'); + $table->string('original_name'); + $table->string('ext'); + $table->string('mine'); + $table->unsignedInteger('size'); + $table->timestamps(); + + $table->foreign('booking_id') + ->references('id') + ->on('booking'); + + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('booking_files'); + } +} diff --git a/packages/iqcontent/laravel-filemanager/src/views/index.blade.php b/packages/iqcontent/laravel-filemanager/src/views/index.blade.php index a2a89b5..e47ea0e 100644 --- a/packages/iqcontent/laravel-filemanager/src/views/index.blade.php +++ b/packages/iqcontent/laravel-filemanager/src/views/index.blade.php @@ -268,7 +268,7 @@ uploadMultiple: false, parallelUploads: 5, clickable: '#upload-button', - dictDefaultMessage: lfm_lang['message-drop'], + dictDefaultMessage: ''+lfm_lang['message-drop'], init: function() { var _this = this; // For the closure this.on('success', function(file, response) { diff --git a/public/css/application.css b/public/css/application.css index 6ffa65a..c5c28b3 100644 --- a/public/css/application.css +++ b/public/css/application.css @@ -341,362 +341,11 @@ figcaption { margin: 0; width: auto; } -/* -.messages-wrapper { - position: relative; - display: -ms-flexbox; - display: flex; - overflow: hidden; - -ms-flex: 1 1 100%; - flex: 1 1 100%; - width: 100% + +.modal-open .tooltip { + z-index: 2120; } -.messages-card { - overflow: hidden -} - -.messages-wrapper, -.messages-sidebox { - transition: all .2s -} - -.messages-sidebox { - -ms-flex-preferred-size: 100%; - flex-basis: 100%; - -ms-flex-positive: 0; - flex-grow: 0 -} - -.messages-wrapper .messages-sidebox, -.messages-card .messages-sidebox { - position: fixed; - left: calc(-14rem - 1px); - z-index: 10; - -ms-flex-preferred-size: auto; - flex-basis: auto; - -ms-flex-positive: 1; - flex-grow: 1; - width: 14rem -} - -[dir=rtl] .messages-wrapper .messages-sidebox, -[dir=rtl] .messages-card .messages-sidebox { - right: calc(-14rem - 1px); - left: auto -} - -.layout-sidenav-100vh .messages-wrapper .messages-sidebox { - height: 100vh -} - -.messages-card .messages-sidebox { - position: absolute; - bottom: 0 -} - -.messages-scroll { - position: absolute; - top: 0; - bottom: 0; - height: 100% -} - -.messages-scroll.messages-content { - position: absolute; - right: 0; - left: 0; - width: 100% -} - -.messages-list .list-group-item { - z-index: auto !important; - display: -ms-flexbox; - display: flex; - -ms-flex-align: center; - align-items: center; - -ms-flex-wrap: wrap; - flex-wrap: wrap; - padding-top: .375rem; - padding-bottom: .375rem; - width: 100%; - border-right: 0; - border-left: 0; - border-radius: 0 -} - -.messages-list .list-group-item:first-child { - border-top: 0 -} - -.messages-list .list-group-item:last-child { - border-bottom: 0 -} - -.messages-list .list-group-item>* { - padding-top: .375rem; - padding-bottom: .375rem -} - -.message-checkbox .custom-control { - display: block !important; - margin: 0; - margin-top: -1px -} - -.message-sender { - min-width: 10rem -} - -.message-subject { - width: 100% -} - -.message-date { - white-space: nowrap -} - -.message-attachment { - display: -ms-flexbox; - display: flex; - -ms-flex-align: center; - align-items: center; - width: 100% -} - -.message-attachment>.media-body { - min-width: 0 -} - -.message-attachment-file, -.message-attachment-img { - display: block; - -ms-flex-positive: 0; - flex-grow: 0; - -ms-flex-negative: 0; - flex-shrink: 0; - width: 4rem; - height: 4rem -} - -.message-attachment-file { - display: inline-block; - text-align: center; - line-height: 4rem -} - -.message-attachment-img { - background-color: transparent; - background-position: center center; - background-size: cover -} - -.message-attachment-filename { - display: block; - overflow: hidden; - width: 100%; - text-overflow: ellipsis; - white-space: nowrap -} - -.default-style .messages-wrapper .messages-sidebox { - z-index: 1081 -} - -.default-style .messages-sidebox-open .messages-sidebox { - left: 0 -} - -.default-style .messages-card .messages-sidebox { - background: #fff; - box-shadow: 0 0 0 1px rgba(24, 28, 33, 0.075) -} - -@media (min-width: 576px) { - .default-style .messages-list .list-group-item { - -ms-flex-wrap: nowrap; - flex-wrap: nowrap - } - - .default-style .message-subject { - width: auto - } - - .default-style .message-date { - margin-left: auto - } -} - -@media (min-width: 768px) { - .default-style .messages-sidebox { - -ms-flex-preferred-size: 14rem; - flex-basis: 14rem - } - - .default-style .messages-wrapper .messages-sidebox { - -ms-flex-preferred-size: auto; - flex-basis: auto - } -} - -@media (min-width: 992px) { - - .default-style .messages-wrapper, - .default-style .messages-sidebox { - transition: none !important - } - - .default-style .messages-wrapper { - padding-left: 14rem - } - - .default-style .messages-sidebox { - z-index: auto !important - } - - .default-style .messages-wrapper .messages-sidebox { - position: absolute; - left: 0; - z-index: auto - } - - .default-style .messages-wrapper .messages-sidebox { - height: 100% !important - } - - .default-style .messages-card .messages-sidebox { - position: static; - right: auto; - left: auto; - -ms-flex-positive: 0; - flex-grow: 0; - height: auto - } -} - -.default-style[dir=rtl] .messages-sidebox-open .messages-sidebox { - right: 0; - left: auto -} - -@media (min-width: 576px) { - .default-style[dir=rtl] .message-date { - margin-right: auto; - margin-left: 0 - } -} - -@media (min-width: 992px) { - .default-style[dir=rtl] .messages-wrapper { - padding-right: 14rem; - padding-left: 0 - } - - .default-style[dir=rtl] .messages-wrapper .messages-sidebox { - right: 0; - left: auto - } -} - -.material-style .messages-wrapper .messages-sidebox { - z-index: 1081 -} - -.material-style .messages-sidebox-open .messages-sidebox { - left: 0 -} - -.material-style .messages-card .messages-sidebox { - background: #fff; - box-shadow: 0 0 0 1px rgba(24, 28, 33, 0.075) -} - -@media (min-width: 576px) { - .material-style .messages-list .list-group-item { - -ms-flex-wrap: nowrap; - flex-wrap: nowrap - } - - .material-style .message-subject { - width: auto - } - - .material-style .message-date { - margin-left: auto - } -} - -@media (min-width: 768px) { - .material-style .messages-sidebox { - -ms-flex-preferred-size: 14rem; - flex-basis: 14rem - } - - .material-style .messages-wrapper .messages-sidebox { - -ms-flex-preferred-size: auto; - flex-basis: auto - } -} - -@media (min-width: 992px) { - - .material-style .messages-wrapper, - .material-style .messages-sidebox { - transition: none !important - } - - .material-style .messages-wrapper { - padding-left: 14rem - } - - .material-style .messages-sidebox { - z-index: auto !important - } - - .material-style .messages-wrapper .messages-sidebox { - position: absolute; - left: 0; - z-index: auto - } - - .material-style .messages-wrapper .messages-sidebox { - height: 100% !important - } - - .material-style .messages-card .messages-sidebox { - position: static; - right: auto; - left: auto; - -ms-flex-positive: 0; - flex-grow: 0; - height: auto - } -} - -.material-style[dir=rtl] .messages-sidebox-open .messages-sidebox { - right: 0; - left: auto -} - -@media (min-width: 576px) { - .material-style[dir=rtl] .message-date { - margin-right: auto; - margin-left: 0 - } -} - -@media (min-width: 992px) { - .material-style[dir=rtl] .messages-wrapper { - padding-right: 14rem; - padding-left: 0 - } - - .material-style[dir=rtl] .messages-wrapper .messages-sidebox { - right: 0; - left: auto - } -} -*/ .btn-next { border-color: rgba(0, 0, 0, 0); background: #8897AA; @@ -780,4 +429,18 @@ figcaption { } .table th, .table td { padding: 0.4rem; -} \ No newline at end of file +} + +.dz-message i { + font-size: 50px; + display: block; + margin-bottom: 16px; + opacity: 0.8; +} +div.dropzone { + border-style: dashed; +} +div.dropzone.dz-drag-hover { + border-style: dashed; +} + diff --git a/public/js/custom.js b/public/js/custom.js index df715a9..3edfda5 100644 --- a/public/js/custom.js +++ b/public/js/custom.js @@ -7,6 +7,29 @@ $('.iq-save-bar').closest('form').find(':input, select, textarea').keydown(funct showIqSaveBar($(this).closest('form')); }); +CookiesAddJSONValue = function(name, value) { + var elements = []; + if(Cookies.get(name)){ + elements = JSON.parse(Cookies.get(name)); + } + if(elements.indexOf(value) === -1){ + elements.push(value); + } + Cookies.set(name, JSON.stringify(elements), { expires:30 }); +}; + + +CookiesRemoveJSONValue = function(name, value) { + var elements = []; + if(Cookies.get(name)){ + elements = JSON.parse(Cookies.get(name)); + } + var index = elements.indexOf(value); + if(index > -1){ + elements.splice(index, 1); + Cookies.set(name, JSON.stringify(elements), { expires:30 }); + } +}; $(function () { @@ -117,7 +140,7 @@ $(function () { $.each(button.data(), function(index, value){ data[index] = value; }); - console.log(data); + //console.log(data); loadModalInner(this, data); }); @@ -130,13 +153,12 @@ $(function () { $.each(button.data(), function(index, value){ data[index] = value; }); - console.log(data); + //console.log(data); loadModalInner(this, data); }); } function loadModalInner(self, data){ - var url = data.route, contentType = 'application/x-www-form-urlencoded; charset=UTF-8'; $.ajax({ @@ -151,9 +173,9 @@ $(function () { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, success: function(data) { - // console.log(data); + // console.log(data); $(data.response.target).find('.modal-dialog').html(data.html); - $(data.response.target + '.selectpicker').selectpicker('refresh'); + $(data.response.target).find('.selectpicker').selectpicker('refresh'); initModalInner(); }, error: function(xhr, status, errorThrown) { @@ -177,8 +199,8 @@ function ajax_object_action(event, object, callback) { data[index] = value; }); var url = data['url']; - /*console.log(data); - console.log(url);*/ + //console.log(data); + //console.log(url); $.ajax({ url: url, data: data, @@ -228,7 +250,7 @@ function update_modal_data_show(e, $ele) { }, success: function(data) { // do what ever you want here. add content to| # | +Datei | +Inhalt | +Datum | ++ |
|---|---|---|---|---|
| {{$booking_files_count++}} | ++ + Reiseanmeldung + + | ++ Gesamtpreis: {{ \App\Services\Util::_number_format($booking_application->total)}} € + | +{{\App\Services\Util::_format_date($booking_application->updated_at, 'date')}} | ++ + + + | +
| {{$booking_files_count++}} | ++ + Reisebestätigung + + | ++ Gesamtpreis: {{ \App\Services\Util::_number_format($booking_confirmation->total)}} € | + Anzahlung: {{ \App\Services\Util::_number_format($booking_confirmation->deposit)}} € | + Restzahlung: {{ \App\Services\Util::_number_format($booking_confirmation->final_payment)}} € + | +{{\App\Services\Util::_format_date($booking_confirmation->updated_at, 'date')}} | ++ + + + | +
| {{$booking_files_count++}} | ++ + Stornobestätigung + + | ++ Stornobetrag: {{ \App\Services\Util::_number_format($booking_storno->total)}} € + | +{{\App\Services\Util::_format_date($booking_storno->updated_at, 'date')}} | ++ + + + | +
| {{$booking_files_count++}} | ++ + Gutschein {{$coupon->number}} + + | ++ Wert: {{ \App\Services\Util::_number_format($coupon->value)}} € | + bis: {{\App\Services\Util::_format_date($coupon->valid_date, 'date')}} | + @if($coupon->is_redeemed) {{\App\Services\Util::_format_date($coupon->redeem_date, 'date')}} @else @endif + | +{{\App\Services\Util::_format_date($coupon->issue_date, 'date')}} | ++ + + + | +
| {{$booking_files_count++}} | ++ + Voucher-ID {{$booking_voucher->id}} + + | ++ + | +{{\App\Services\Util::_format_date($booking_voucher->updated_at, 'date')}} | ++ + + + | +
| {{$booking_files_count++}} | ++ + Sicherungsschein Nr. {{$insurance_certificate->internal_id}} + + | ++ + | +{{\App\Services\Util::_format_date($insurance_certificate->updated_at, 'date')}} | ++ + + + | +
| {{$booking_files_count++}} | ++ Policennummer {{$travel_insurances->policy_number}} + | ++ Gesamtprämie: {{ \App\Services\Util::_number_format($travel_insurances->premium)}} € + | +{{\App\Services\Util::_format_date($travel_insurances->updated_at, 'date')}} | ++ + | +
| {{$booking_files_count++}} | ++ + {{$security_certificate->name}} + + | ++ {{ $security_certificate->formatBytes() }} + | +{{\App\Services\Util::_format_date($security_certificate->created_at, 'date')}} | ++ + + + | +
| {{$booking_files_count++}} | ++ + {{$booking_file->original_name}} + + | ++ {{ $booking_file->mine }} | {{ $booking_file->formatBytes() }} + | +{{\App\Services\Util::_format_date($booking_file->created_at, 'date')}} | ++ + + + | +
| # | -Datei | -Inhalt | -Datum | -- |
|---|---|---|---|---|
| {{$booking_files_count++}} | -- - Reiseanmeldung - - | -- Gesamtpreis: {{ \App\Services\Util::_number_format($booking_application->total)}} € - | -{{\App\Services\Util::_format_date($booking_application->updated_at, 'date')}} | -- - - - | -
| {{$booking_files_count++}} | -- - Reisebestätigung - - | -- Gesamtpreis: {{ \App\Services\Util::_number_format($booking_confirmation->total)}} € | - Anzahlung: {{ \App\Services\Util::_number_format($booking_confirmation->deposit)}} € | - Restzahlung: {{ \App\Services\Util::_number_format($booking_confirmation->final_payment)}} € - | -{{\App\Services\Util::_format_date($booking_confirmation->updated_at, 'date')}} | -- - - - | -
| {{$booking_files_count++}} | -- - Stornobestätigung - - | -- Stornobetrag: {{ \App\Services\Util::_number_format($booking_storno->total)}} € - | -{{\App\Services\Util::_format_date($booking_storno->updated_at, 'date')}} | -- - - - | -
| {{$booking_files_count++}} | -- - Gutschein {{$coupon->number}} - - | -- Wert: {{ \App\Services\Util::_number_format($coupon->value)}} € | - bis: {{\App\Services\Util::_format_date($coupon->valid_date, 'date')}} | - @if($coupon->is_redeemed) {{\App\Services\Util::_format_date($coupon->redeem_date, 'date')}} @else @endif - | -{{\App\Services\Util::_format_date($coupon->issue_date, 'date')}} | -- - - - | -
| {{$booking_files_count++}} | -- - Voucher-ID {{$booking_voucher->id}} - - | -- - | -{{\App\Services\Util::_format_date($booking_voucher->updated_at, 'date')}} | -- - - - | -
| {{$booking_files_count++}} | -- - Sicherungsschein Nr. {{$insurance_certificate->internal_id}} - - | -- - | -{{\App\Services\Util::_format_date($insurance_certificate->updated_at, 'date')}} | -- - - - | -
| {{$booking_files_count++}} | -- Policennummer {{$travel_insurances->policy_number}} - | -- Gesamtprämie: {{ \App\Services\Util::_number_format($travel_insurances->premium)}} € - | -{{\App\Services\Util::_format_date($travel_insurances->updated_at, 'date')}} | -- - | -
Platzhalter: #geehrte/r# #Anrede# #Vorname# #Nachname# #Reiseland# #Programm# #Anreisedatum# #Abreisedatum# #Buchungsdatum# #Airline#
+Platzhalter: #geehrte/r# #Anrede# #Titel# #Vorname# #Nachname# #Reiseland# #Programm# #Anreisedatum# #Abreisedatum# #Buchungsdatum# #Airline#
@endif @if($value->show === 'single' || $value->show === 'reply')