diff --git a/.idea/mein.sterntours.test.iml b/.idea/mein.sterntours.test.iml index d93092c..0356a1b 100644 --- a/.idea/mein.sterntours.test.iml +++ b/.idea/mein.sterntours.test.iml @@ -5,6 +5,9 @@ + + + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 7b0fa8d..65fd67d 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,6 +2,9 @@ + + + @@ -25,24 +28,24 @@ - - - - - - - - - - - - + + + + + + + + + - - - - - + + + + + + + + @@ -90,12 +93,14 @@ - - - - - - + + + + + + + + + + + + + + + @@ -330,13 +342,6 @@ - - - - - - - @@ -781,6 +792,10 @@ + + + + @@ -790,10 +805,10 @@ - + - + @@ -811,31 +826,32 @@ - + - + + - + - + - + - + - + - + diff --git a/app/Http/Controllers/CMS/CMSFeWoController.php b/app/Http/Controllers/CMS/CMSFeWoController.php new file mode 100755 index 0000000..37ee24d --- /dev/null +++ b/app/Http/Controllers/CMS/CMSFeWoController.php @@ -0,0 +1,164 @@ +identifier_content = config('fewo.identifier_content'); + $this->identifier_fewo = config('fewo.identifier_fewo'); + } + /* + * ALL + */ + public function all($step = false) + { + + $data = [ + 'contents' => CMSContent::where('identifier', '=', $this->identifier_content)->get()->sortBy('pos'), + 'identifier_content' => $this->identifier_content, + 'step' => $step + ]; + return view('cms.fewo.all.index', $data); + } + + public function storeAll($step = false) + { + $data = Request::all(); + + /*if($data['action'] === 'saveAll') { + //saveAll on each change + }*/ + $i = 1; + if(isset($data['contents'] )) { + foreach ($data['contents'] as $content_id => $item) { + $content = CMSContent::findOrFail($content_id); + $content->setObjectBy('page-break', (isset($item['page-break']) ? true : false)); + $content->name = $item['name']; + $content->slug = null; + $content->decimal = isset($item['in_pdf']) ? 1 : 0; + $content->full_text = $item['full_text']; + $content->pos = $i++; + $content->save(); + } + } + //last + if($data['action'] === 'addItem'){ + $create = [ + 'name' => 'Abschnitt', + 'field' => 'full_text', + 'decimal' => 1, + 'identifier' => $this->identifier_content, + 'pos' => $i, + ]; + CMSContent::create($create); + //store in cms old Datebase + \App\Models\Sym\CmsContent::create($create); + } + + \Session()->flash('alert-save', '1'); + return redirect(route('cms_fewo_all', [$step])); + } + + public function deleteAll($id){ + $content = CMSContent::findOrFail($id); + $content->delete(); + $m = \App\Models\Sym\CmsContent::find($id); + $m->delete(); + \Session()->flash('alert-success', __('Content gelöscht')); + return back(); //redirect(route('cms_content_all')); + } + /* + * CONTENT + */ + public function content() + { + $data = [ + 'fewo_lodgings' => FewoLodging::all() + ]; + return view('cms.fewo.content.index', $data); + } + + public function detail($id, $step = false) + { + $fewo = FewoLodging::findOrFail($id); + $identifier_fewo = $this->identifier_fewo.Util::sanitize($fewo->single_name); // //this->identifier_fewo = 'fewo-pdf-'; + + $data = [ + 'contents' => CMSContent::where('identifier', '=', $this->identifier_content)->get()->sortBy('pos'), + 'fewo' => $fewo, + 'identifier_content' => $this->identifier_content, + 'identifier_fewo' => $identifier_fewo, + 'step' => $step + ]; + return view('cms.fewo.content.detail', $data); + } + + public function store($id, $step = false) + { + $data = Request::all(); + $fewo = FewoLodging::findOrFail($id); + $identifier_fewo = $this->identifier_fewo.Util::sanitize($fewo->single_name); + + $i = 1; + $last_content_id = null; + if(isset($data['contents'] )) { + foreach ($data['contents'] as $content_id => $item) { + $content = CMSContent::findOrFail($content_id); + if ($item['identifier'] === $this->identifier_content) { + $last_content_id = $content->id; + } + if ($item['identifier'] === $identifier_fewo) { + $content->setObjectBy('page-break', (isset($item['page-break']) ? true : false)); + $content->name = $item['name']; + $content->slug = null; + $content->decimal = isset($item['in_pdf']) ? 1 : 0; + $content->full_text = $item['full_text']; + $content->integer = $last_content_id != null ? $last_content_id : $content->integer; //is the main obj + $content->pos = $i++; + $content->save(); + } + } + } + + if($data['action'] === 'previewPDF'){ + $pdf_content = BookingFewo::getFeWoCMSContentForPDF($this->identifier_content, $identifier_fewo); + $pdf_file = new CreatePDF('pdf.fewo_instructions'); + return $pdf_file->create($fewo, $pdf_content); + } + + if($data['action'] === 'addItem' && isset($data['content_pos_id'])) { + $create = [ + 'name' => 'Abschnitt', + 'field' => 'full_text', + 'decimal' => 1, + 'integer' => $data['content_pos_id'], + 'identifier' => $identifier_fewo, + 'pos' => 0, + ]; + CMSContent::create($create); + //store in cms old Datebase + \App\Models\Sym\CmsContent::create($create); + } + + \Session()->flash('alert-save', '1'); + return redirect(route('cms_fewo_content_detail', [$id, $step])); + } + +} diff --git a/app/Http/Controllers/CustomerFileController.php b/app/Http/Controllers/CustomerFileController.php index 7521746..4b63e68 100755 --- a/app/Http/Controllers/CustomerFileController.php +++ b/app/Http/Controllers/CustomerFileController.php @@ -8,10 +8,14 @@ use App\Models\BookingConfirmation; use App\Models\BookingStorno; use App\Models\BookingVoucher; use App\Models\Coupon; +use App\Models\FewoLodging; use App\Models\InsuranceCertificate; use App\Models\TravelInsurance; use App\Repositories\CustomerFileRepository; +use App\Services\BookingFewo; use App\Services\CreateCouponPDF; +use App\Services\CreatePDF; +use App\Services\Util; use Carbon; use Illuminate\Database\Eloquent\Collection; use Illuminate\Support\Facades\URL; @@ -39,7 +43,6 @@ class CustomerFileController extends Controller public function show($model, $id, $cd = false){ $content_disposition = $cd ? 'attachment' : 'inline'; - $file = false; $filename = ""; switch ($model){ @@ -90,6 +93,18 @@ class CustomerFileController extends Controller } break; + case 'fewo_instruction_pdf': + $fewo = FewoLodging::findOrFail($id); + $identifier_content = config('fewo.identifier_content'); + $identifier_fewo = config('fewo.identifier_fewo'); + $identifier_fewo = $identifier_fewo.Util::sanitize($fewo->single_name); + $pdf_name = \App\Services\BookingFewo::getFeWoInstructionPDFName($fewo); + $pdf_content = BookingFewo::getFeWoCMSContentForPDF($identifier_content, $identifier_fewo); + $pdf_file = new CreatePDF('pdf.fewo_instructions'); + return $pdf_file->create($fewo, $pdf_content, $pdf_name, $cd); + + break; + } diff --git a/app/Http/Controllers/DraftController.php b/app/Http/Controllers/DraftController.php index 6956063..dd31846 100755 --- a/app/Http/Controllers/DraftController.php +++ b/app/Http/Controllers/DraftController.php @@ -62,7 +62,7 @@ class DraftController extends Controller $i = 1; if(isset($data['draft_item'])){ foreach ($data['draft_item'] as $draft_item_id => $draft_item){ - if($data['action'] == 'saveAllFromOld'){ + if($data['action'] === 'saveAllFromOld'){ $di = $draft->draft_items()->create([]); }else{ $di = DraftItem::findOrFail($draft_item_id); @@ -82,7 +82,7 @@ class DraftController extends Controller } } - if($data['action'] == 'addItem'){ + if($data['action'] === 'addItem'){ $draft->draft_items()->create(['pos' => $i]); } if(strpos($data['action'], 'up_') !== false) { diff --git a/app/Http/Controllers/TravelUserBookingFewoController.php b/app/Http/Controllers/TravelUserBookingFewoController.php index 90d3d33..ca5487d 100755 --- a/app/Http/Controllers/TravelUserBookingFewoController.php +++ b/app/Http/Controllers/TravelUserBookingFewoController.php @@ -21,14 +21,13 @@ use Request; class TravelUserBookingFewoController extends Controller { protected $userBookingFewoRepo; + // protected $identifier_fewo; public function __construct(TravelUserBookingFewoRepository $userBookingFewoRepo) { $this->middleware('admin'); $this->userBookingFewoRepo = $userBookingFewoRepo; - - - + // $this->identifier_fewo = 'fewo-pdf-'; } public function index($step = false) @@ -59,6 +58,11 @@ class TravelUserBookingFewoController extends Controller $id = $travel_user_booking_fewo->id; $replace_info_text['fewo_user_anrede'] = $travel_user_booking_fewo->getUserSalutation(); $replace_info_text['fewo_adresse'] = $travel_user_booking_fewo->getNameAddressLocation(", "); + + /* if($travel_user_booking_fewo->fewo_lodging){ + + $this->identifier_fewo = $this->identifier_fewo.Util::sanitize($travel_user_booking_fewo->fewo_lodging->single_name); + }*/ } if(!$travel_user_booking_fewo->info_mail_text) { $travel_user_booking_fewo->info_mail_text = CMSContent::getContentBySlug('pdf-vorlage-anreiseinfo-fewo'); @@ -78,10 +82,10 @@ class TravelUserBookingFewoController extends Controller public function store($id) { $data = Request::all(); - if($data['action'] == 'saveAll'){ + if($data['action'] === 'saveAll'){ return $this->userBookingFewoRepo->update($id, $data); } - if($data['action'] == 'createInvoice'){ + if($data['action'] === 'createInvoice'){ if(!TravelUserBookingFewo::find($id)){ \Session()->flash('alert-error', __('Buchung nicht gefunden.')); return back()->withRequest(Request::all()); @@ -97,7 +101,7 @@ class TravelUserBookingFewoController extends Controller } } - if($data['action'] == 'createTravelInfo'){ + if($data['action'] === 'createTravelInfo'){ if(!TravelUserBookingFewo::find($id)){ \Session()->flash('alert-error', __('Buchung nicht gefunden.')); return back()->withRequest(Request::all()); @@ -114,7 +118,7 @@ class TravelUserBookingFewoController extends Controller } } - if($data['action'] == 'sendMailtoUser') { + if($data['action'] === 'sendMailtoUser') { $travel_user_booking_fewo = TravelUserBookingFewo::findOrFail($id); if($travel_user_booking_fewo->travel_user_id && $travel_user_booking_fewo->travel_user->email){ $mail_bbc = config('mail.mail_bbc'); @@ -128,7 +132,7 @@ class TravelUserBookingFewoController extends Controller } } - if($data['action'] == 'sendInfosMailtoUser') { + if($data['action'] === 'sendInfosMailtoUser') { $travel_user_booking_fewo = TravelUserBookingFewo::findOrFail($id); if($travel_user_booking_fewo->travel_user_id && $travel_user_booking_fewo->travel_user->email){ $mail_bbc = config('mail.mail_bbc'); @@ -142,7 +146,7 @@ class TravelUserBookingFewoController extends Controller } } - if($data['action'] == 'sendMailtoService') { + if($data['action'] === 'sendMailtoService') { $travel_user_booking_fewo = TravelUserBookingFewo::findOrFail($id); if($travel_user_booking_fewo){ $mail_bbc = config('mail.mail_bbc'); @@ -160,7 +164,7 @@ class TravelUserBookingFewoController extends Controller } } - if($data['action'] == 'sendMailtoEmployee') { + if($data['action'] === 'sendMailtoEmployee') { $travel_user_booking_fewo = TravelUserBookingFewo::findOrFail($id); if($travel_user_booking_fewo){ $mails = explode(",", Request::get('send_mail_employee_mail')); @@ -220,7 +224,6 @@ class TravelUserBookingFewoController extends Controller public function getTravelUserBookingFewos() { - $query = $this->prozessTravelUserBookingFewosSearch(); return \DataTables::eloquent($query) diff --git a/app/Models/CMSContent.php b/app/Models/CMSContent.php index 4d53889..1907ec1 100644 --- a/app/Models/CMSContent.php +++ b/app/Models/CMSContent.php @@ -219,6 +219,15 @@ class CMSContent extends Model $this->attributes['integer'] = intval($value); } + public function getObjectBy($key){ + return isset($this->object[$key]) ? $this->object[$key] : false; + } + + public function setObjectBy($key, $value){ + $obj = $this->object; + $obj[$key] = $value; + $this->object = $obj; + } public static function getContentBySlug($slug){ $CMSContent = CMSContent::whereSlug(trim($slug))->first(); @@ -251,4 +260,6 @@ class CMSContent extends Model public static function getModelBySlug($slug){ return CMSContent::whereSlug(trim($slug))->first(); } + + } diff --git a/app/Models/FewoLodging.php b/app/Models/FewoLodging.php index 22f597d..f2f8909 100644 --- a/app/Models/FewoLodging.php +++ b/app/Models/FewoLodging.php @@ -84,6 +84,7 @@ class FewoLodging extends Model 'type_id', 'name', 'single_name', + 'pdf_name', 'description', 'equipment', 'adress1', diff --git a/app/Services/BookingFewo.php b/app/Services/BookingFewo.php index 6158c98..6280760 100644 --- a/app/Services/BookingFewo.php +++ b/app/Services/BookingFewo.php @@ -76,4 +76,29 @@ class BookingFewo } return []; } + + public static function getFeWoInstructionPDFName($fewo){ + return "HINWEISE-FERIENWOHNUNG-".$fewo->pdf_name.".pdf"; + } + public static function getFeWoCMSContent($content, $identifier_fewo){ + return CMSContent::where('identifier', '=', $identifier_fewo)->where('integer', $content->id)->get()->sortBy('pos'); + } + + public static function getFeWoCMSContentForPDF($identifier_content, $identifier_fewo){ + $pdf_content = []; + $contents = CMSContent::where('identifier', '=', $identifier_content)->get()->sortBy('pos'); + foreach ($contents as $content){ + if($content->decimal > 0){ //in_pdf + $pdf_content[] = $content; + } + if($fewo_contents = BookingFewo::getFeWoCMSContent($content, $identifier_fewo)){ + foreach ($fewo_contents as $fewo_content){ + if($fewo_content->decimal > 0){ //in_pdf + $pdf_content[] = $fewo_content; + } + } + } + } + return $pdf_content; + } } \ No newline at end of file diff --git a/app/Services/CreatePDF.php b/app/Services/CreatePDF.php new file mode 100644 index 0000000..49637c4 --- /dev/null +++ b/app/Services/CreatePDF.php @@ -0,0 +1,60 @@ +view = $view; + } + + public function create($fewo, $contents, $name='test.pdf', $output='stream'){ + + header('Content-type: text/html; charset=UTF-8') ;//chrome + //dd($data); + $data = [ + 'contents' => $contents, + 'fewo' => $fewo, + ]; + $pdf = app('dompdf.wrapper'); + $pdf->getDomPDF()->set_option("enable_php", true); + $pdf->loadView($this->view, $data); + $pdf->setPaper('A4', 'portrait'); + + + if($output === 'stream'){ + return $pdf->stream($name); + } + if($output === 'download'){ + return $pdf->download($name); + } + + if($output === 'save'){ + /* $dir = $invoice->getInvoiceStorageDir(); + if(!Storage::disk('invoices')->exists( $dir )){ + Storage::disk('invoices')->makeDirectory($dir); //creates directory + } + $path = Storage::disk('invoices')->getAdapter()->getPathPrefix(); + + if($preview){ + $filename = "preview.pdf"; + }else{ + $filename = $invoice->invoice_number.".pdf"; + } + + $pdf->save($path.$dir.$filename); + + return $path.$dir.$filename; */ + //return $pdf->download($name); + } + } + +} +?> diff --git a/config/fewo.php b/config/fewo.php new file mode 100644 index 0000000..a857aba --- /dev/null +++ b/config/fewo.php @@ -0,0 +1,6 @@ + 'fewo-pdf-general', + 'identifier_fewo' => 'fewo-pdf-' +]; diff --git a/config/permissions.php b/config/permissions.php index 0057055..5a95f0e 100755 --- a/config/permissions.php +++ b/config/permissions.php @@ -23,6 +23,7 @@ return [ 'cms' => ['name' => 'ADMIN CMS' , 'color' => 'secondary'], 'cms-iq-assets' => ['name' => 'ADMIN CMS > Medien' , 'color' => 'secondary'], 'cms-tg' => ['name' => 'ADMIN CMS > Reiseführer' , 'color' => 'secondary'], + 'cms-fewo' => ['name' => 'ADMIN CMS > FeWo' , 'color' => 'secondary'], 'cms-fb' => ['name' => 'ADMIN CMS > Feedback' , 'color' => 'secondary'], 'cms-sb' => ['name' => 'ADMIN CMS > Sidebar' , 'color' => 'secondary'], 'cms-cn' => ['name' => 'ADMIN CMS > Inhalte' , 'color' => 'secondary'], diff --git a/database/migrations/2019_03_20_132556_create_fewo_lodging_table.php b/database/migrations/2019_03_20_132556_create_fewo_lodging_table.php index 753094f..3bf72e6 100644 --- a/database/migrations/2019_03_20_132556_create_fewo_lodging_table.php +++ b/database/migrations/2019_03_20_132556_create_fewo_lodging_table.php @@ -23,6 +23,7 @@ class CreateFewoLodgingTable extends Migration $table->integer('type_id')->nullable(); $table->string('name', 255); $table->string('single_name', 255); + $table->string('pdf_name', 255); $table->longText('description'); $table->longText('equipment'); $table->string('adress1', 255); diff --git a/public/js/summernote-cleaner.js b/public/js/summernote-cleaner.js new file mode 100755 index 0000000..ad456fe --- /dev/null +++ b/public/js/summernote-cleaner.js @@ -0,0 +1,178 @@ +/* https://github.com/DiemenDesign/summernote-cleaner */ +(function (factory) { + if (typeof define === 'function' && define.amd) { + define(['jquery'], factory); + } else if (typeof module === 'object' && module.exports) { + module.exports = factory(require('jquery')); + } else { + factory(window.jQuery); + } +} +(function ($) { + $.extend(true, $.summernote.lang, { + 'en-US': { + cleaner: { + tooltip: 'Cleaner', + not: 'Text has been Cleaned!!!', + limitText: 'Text', + limitHTML: 'HTML' + } + } + }); + $.extend($.summernote.options, { + cleaner: { + action: 'both', // both|button|paste 'button' only cleans via toolbar button, 'paste' only clean when pasting content, both does both options. + newline: '
', // Summernote's default is to use '


' + notStyle: 'position:absolute;top:0;left:0;right:0', + icon: '', + keepHtml: true, //Remove all Html formats + keepOnlyTags: [], // If keepHtml is true, remove all tags except these + keepClasses: false, //Remove Classes + badTags: ['style', 'script', 'applet', 'embed', 'noframes', 'noscript', 'html'], //Remove full tags with contents + badAttributes: ['style', 'start'], //Remove attributes from remaining tags + limitChars: 0, // 0|# 0 disables option + limitDisplay: 'both', // none|text|html|both + limitStop: false // true/false + } + }); + $.extend($.summernote.plugins, { + 'cleaner': function (context) { + var self = this, + ui = $.summernote.ui, + $note = context.layoutInfo.note, + $editor = context.layoutInfo.editor, + options = context.options, + lang = options.langInfo; + var cleanText = function (txt, nlO) { + var out = txt; + if (!options.cleaner.keepClasses) { + var sS = /(\n|\r| class=(")?Mso[a-zA-Z]+(")?)/g; + out = txt.replace(sS, ' '); + } + var nL = /(\n)+/g; + out = out.replace(nL, nlO); + if (options.cleaner.keepHtml) { + var cS = new RegExp('', 'gi'); + out = out.replace(cS, ''); + var tS = new RegExp('<(/)*(meta|link|\\?xml:|st1:|o:|font)(.*?)>', 'gi'); + out = out.replace(tS, ''); + var bT = options.cleaner.badTags; + for (var i = 0; i < bT.length; i++) { + tS = new RegExp('<' + bT[i] + '\\b.*>.*', 'gi'); + out = out.replace(tS, ''); + } + var allowedTags = options.cleaner.keepOnlyTags; + if (typeof(allowedTags) == "undefined") allowedTags = []; + if (allowedTags.length > 0) { + allowedTags = (((allowedTags||'') + '').toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join(''); + var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi; + out = out.replace(tags, function($0, $1) { + return allowedTags.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '' + }); + } + var bA = options.cleaner.badAttributes; + for (var ii = 0; ii < bA.length; ii++ ) { + //var aS=new RegExp(' ('+bA[ii]+'="(.*?)")|('+bA[ii]+'=\'(.*?)\')', 'gi'); + var aS = new RegExp(' ' + bA[ii] + '=[\'|"](.*?)[\'|"]', 'gi'); + out = out.replace(aS, ''); + aS = new RegExp(' ' + bA[ii] + '[=0-9a-z]', 'gi'); + out = out.replace(aS, ''); + } + } + return out; + }; + if (options.cleaner.action == 'both' || options.cleaner.action == 'button') { + context.memo('button.cleaner', function () { + var button = ui.button({ + contents: options.cleaner.icon, + tooltip: lang.cleaner.tooltip, + container: 'body', + click: function () { + if ($note.summernote('createRange').toString()) + $note.summernote('pasteHTML', $note.summernote('createRange').toString()); + else + $note.summernote('code', cleanText($note.summernote('code'))); + if ($editor.find('.note-status-output').length > 0) + $editor.find('.note-status-output').html('
' + lang.cleaner.not + '
'); + } + }); + return button.render(); + }); + } + this.events = { + 'summernote.init': function () { + if ($.summernote.interface === 'lite') { + // $("head").append(''); + } + if (options.cleaner.limitChars != 0 || options.cleaner.limitDisplay != 'none') { + var textLength = $editor.find(".note-editable").text().replace(/(<([^>]+)>)/ig, "").replace(/( )/, " "); + var codeLength = $editor.find('.note-editable').html(); + var lengthStatus = ''; + if (textLength.length > options.cleaner.limitChars && options.cleaner.limitChars > 0) + lengthStatus += 'text-danger">'; + else + lengthStatus += '">'; + if (options.cleaner.limitDisplay == 'text' || options.cleaner.limitDisplay == 'both') lengthStatus += lang.cleaner.limitText + ': ' + textLength.length; + if (options.cleaner.limitDisplay == 'both') lengthStatus += ' / '; + if (options.cleaner.limitDisplay == 'html' || options.cleaner.limitDisplay == 'both') lengthStatus += lang.cleaner.limitHTML + ': ' + codeLength.length; + // $editor.find('.note-status-output').html(']+)>)/ig, "").replace(/( )/, " "); + var codeLength = $editor.find('.note-editable').html(); + var lengthStatus = ''; + if (options.cleaner.limitStop == true && textLength.length >= options.cleaner.limitChars) { + var key = e.keyCode; + allowed_keys = [8, 37, 38, 39, 40, 46] + if ($.inArray(key, allowed_keys) != -1) { + $editor.find('.cleanerLimit').removeClass('text-danger'); + return true; + } else { + $editor.find('.cleanerLimit').addClass('text-danger'); + e.preventDefault(); + e.stopPropagation(); + } + } else { + if (textLength.length > options.cleaner.limitChars && options.cleaner.limitChars > 0) + lengthStatus += 'text-danger">'; + else + lengthStatus += '">'; + if (options.cleaner.limitDisplay == 'text' || options.cleaner.limitDisplay == 'both') + lengthStatus += lang.cleaner.limitText + ': ' + textLength.length; + if (options.cleaner.limitDisplay == 'both') + lengthStatus += ' / '; + if (options.cleaner.limitDisplay == 'html' || options.cleaner.limitDisplay == 'both') + lengthStatus += lang.cleaner.limitHTML + ': ' + codeLength.length; + //$editor.find('.note-status-output').html(' 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./); + var ffox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; + if (msie) + var text = window.clipboardData.getData("Text"); + else + var text = e.originalEvent.clipboardData.getData(options.cleaner.keepHtml ? 'text/html' : 'text/plain'); + if (text) { + if (msie || ffox) + setTimeout(function () { + $note.summernote('pasteHTML', cleanText(text, options.cleaner.newline)); + }, 1); + else + $note.summernote('pasteHTML', cleanText(text, options.cleaner.newline)); + /*if ($editor.find('.note-status-output').length > 0) + $editor.find('.note-status-output').html('
' + lang.cleaner.not + '
');*/ + } + } + } + } + } + }); +})); diff --git a/public/wartung.html b/public/wartung.html new file mode 100644 index 0000000..f55aba5 --- /dev/null +++ b/public/wartung.html @@ -0,0 +1,314 @@ + + + + + Wartungsmodus + + + + +
+

Unsere Website befindet sich gerade in der Wartung.

+ +

+ Wir stehen Ihnen bald wieder zur Verfügung. Entschuldigen Sie etwaige Unannehmlichkeiten. +

+ +
+ +

Our website is currently undergoing maintenance.

+ +

+ We'll be back very soon. Sorry for any inconvenience. +

+ +
+
+ + \ No newline at end of file diff --git a/resources/views/cms/fewo/all/index.blade.php b/resources/views/cms/fewo/all/index.blade.php new file mode 100755 index 0000000..411ec74 --- /dev/null +++ b/resources/views/cms/fewo/all/index.blade.php @@ -0,0 +1,209 @@ +@extends('layouts.layout-2') + +@section('content') + + + +

+ FeWo Allgemein +

+ + +@endsection \ No newline at end of file diff --git a/resources/views/cms/fewo/content/detail.blade.php b/resources/views/cms/fewo/content/detail.blade.php new file mode 100755 index 0000000..464a9b5 --- /dev/null +++ b/resources/views/cms/fewo/content/detail.blade.php @@ -0,0 +1,273 @@ +@extends('layouts.layout-2') + +@section('content') + + + +

+ FeWo Inhalt {{ $fewo->name }} +

+ + +@endsection \ No newline at end of file diff --git a/resources/views/cms/fewo/content/index.blade.php b/resources/views/cms/fewo/content/index.blade.php new file mode 100755 index 0000000..07db94e --- /dev/null +++ b/resources/views/cms/fewo/content/index.blade.php @@ -0,0 +1,85 @@ +@extends('layouts.layout-2') + +@section('content') + +

+ FeWo Inhalte +

+ + @if ($errors->any()) +
+
+
+
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+
+
+
+ @endif + +
+
+ + + + + + + + + + + + + + @foreach($fewo_lodgings as $value) + + + + + + + + + + + @endforeach + +
 {{__('Name')}}{{__('Adresse')}}{{__('Personen')}}{{__('Erwachsenen')}}{{__('Kinder')}}
+ + + + {{ $value->name }} + {{ $value->adress1 }}, {{ $value->zip_code }} {{ $value->city }} + + {{ $value->maximum_persons }} + + {{ $value->maximum_adults }} + + {{ $value->maximum_childs }} +
+
+ {{-- + + --}} + +
+@endsection \ No newline at end of file diff --git a/resources/views/drafts/detail.blade.php b/resources/views/drafts/detail.blade.php index 9da458a..a9ef6df 100755 --- a/resources/views/drafts/detail.blade.php +++ b/resources/views/drafts/detail.blade.php @@ -44,7 +44,6 @@ - - - - - - {!! Form::open(['url' => route('draft_detail', [$id]), 'class' => 'form-horizontal', 'id'=>'lead-form-validation']) !!} @@ -133,7 +127,6 @@ - @if(count($draft->draft_items)) @php($i = 1)
@@ -160,59 +153,60 @@ @foreach($draft->draft_items as $draft_item) - draft_type) style="background-color: {{ $draft_item->draft_type->color }}" @endif> - - + draft_type) style="background-color: {{ $draft_item->draft_type->color }}" @endif> + + - - {{ $i++ }} - - - - - - - - - - -
- + + {!! HTMLHelper::getDraftTypes($draft_item->draft_type_id) !!} - {{ Form::text('draft_item['.$draft_item->id.'][price_adult]', $draft_item->price_adult, array('placeholder'=>__('Preis in €'), 'class'=>'form-control', 'id'=>'draft_item_'.$draft_item->id.'_price_adult',)) }} - - - -
- - -
- + + {!! HTMLHelper::getRangeOptions($draft_item->days_start, 30, ' Tag(e)') !!} - {{ Form::text('draft_item['.$draft_item->id.'][price_children]', $draft_item->price_children, array('placeholder'=>__('Preis in €'), 'class'=>'form-control', 'id'=>'draft_item_'.$draft_item->id.'_price_children')) }} - - - -
- - - - - - + + + + + +
+ + {{ Form::text('draft_item['.$draft_item->id.'][price_adult]', $draft_item->price_adult, array('placeholder'=>__('Preis in €'), 'class'=>'form-control', 'id'=>'draft_item_'.$draft_item->id.'_price_adult',)) }} + + + +
+ + +
+ + {{ Form::text('draft_item['.$draft_item->id.'][price_children]', $draft_item->price_children, array('placeholder'=>__('Preis in €'), 'class'=>'form-control', 'id'=>'draft_item_'.$draft_item->id.'_price_children')) }} + + + +
+ + + + + + + draft_type) style="background-color: {{ $draft_item->draft_type->color }}" @endif class="border-none"> {{ Form::textarea('draft_item['.$draft_item->id.'][service]', $draft_item->service, array('placeholder'=>__('Leistungen'), 'class'=>'form-control autoExpand', 'id'=>'draft_item_'.$draft_item->id.'_service', 'rows'=>'1', 'data-min-rows'=>'1')) }} @@ -223,10 +217,8 @@ {{__('in PDF')}} - - - + @endforeach
diff --git a/resources/views/layouts/application.blade.php b/resources/views/layouts/application.blade.php index befc6dc..3dcbd95 100755 --- a/resources/views/layouts/application.blade.php +++ b/resources/views/layouts/application.blade.php @@ -139,13 +139,16 @@ + + + - - @if(isset($lfm_helper)) + + @endif @@ -311,6 +314,36 @@ }, }); + + $('.summernote-air').summernote({ + airMode: true, + lang: 'de-DE', + placeholder: 'Text ...', + tabsize: 2, + popover: { air:[ + ['style', ['style']], + ['font', ['bold', 'italic', 'underline', 'clear']], + ['font', ['strikethrough']], + ['para', ['ul', 'ol', 'paragraph']], + ['insert', ['link']], + ['color', ['color']], + ['view', ['codeview']], + ] }, + cleaner:{ + action: 'paste', // both|button|paste 'button' only cleans via toolbar button, 'paste' only clean when pasting content, both does both options. + newline: '
', // Summernote's default is to use '


' + notStyle: 'position:absolute;top:0;left:0;right:0', // Position of Notification + icon: '[Your Button]', + keepHtml: false, // Remove all Html formats + keepOnlyTags: ['

', '
', '

+ @endif + @if(Auth::user()->isPermission('cms-fewo')) +
  • + + +
    FeWo
    +
    + +
  • @endif @if(Auth::user()->isPermission('cms-fb'))
  • @@ -171,31 +187,31 @@
    Sidebar
  • @endif - @if(Auth::user()->isPermission('cms-cn')) -
  • - - -
    Inhalte
    -
    -
      - @if(Auth::user()->isPermission('cms-cn-in')) -
    • -
      Infos
      + @if(Auth::user()->isPermission('cms-cn')) +
    • + + +
      Inhalte
      +
      +
        + @if(Auth::user()->isPermission('cms-cn-in')) +
      • +
        Infos
        +
      • + @endif + @if(Auth::user()->isPermission('cms-cn-al')) +
      • +
        Allgemein
      • - @endif - @if(Auth::user()->isPermission('cms-cn-al')) -
      • -
        Allgemein
        -
      • - @endif - @if(Auth::user()->isPermission('cms-cn-au')) -
      • -
        Autoren
        -
      • - @endif -
      -
    • - @endif + @endif + @if(Auth::user()->isPermission('cms-cn-au')) +
    • +
      Autoren
      +
    • + @endif +
    +
  • + @endif @endif @endif diff --git a/resources/views/pdf/fewo_instructions.blade.php b/resources/views/pdf/fewo_instructions.blade.php new file mode 100644 index 0000000..f94348e --- /dev/null +++ b/resources/views/pdf/fewo_instructions.blade.php @@ -0,0 +1,40 @@ +@extends('pdf.layout-small') + +@section('content') + + +

    HINWEISE FERIENWOHNUNG STERN USEDOM

    +

    {{$fewo->single_name}} in der {{ $fewo->adress1 }} in {{ $fewo->zip_code }} {{ $fewo->city }}

    +
    + @foreach($contents as $content) + @if($content->getObjectBy('page-break')) +
    + @endif +
    +

    {{$content->name}}

    +
    + {!! $content->getContent() !!} +
    +
    + @endforeach +@endsection \ No newline at end of file diff --git a/resources/views/pdf/layout-small.blade.php b/resources/views/pdf/layout-small.blade.php new file mode 100644 index 0000000..6aa4a3e --- /dev/null +++ b/resources/views/pdf/layout-small.blade.php @@ -0,0 +1,143 @@ + + + + + + STERN TOURS + + + + +
    + STERNTOURS +
    + +
    +
    + @yield('content') +
    +
    + + \ No newline at end of file diff --git a/resources/views/pdf/layout.blade.php b/resources/views/pdf/layout.blade.php index 1674076..7e7cd14 100644 --- a/resources/views/pdf/layout.blade.php +++ b/resources/views/pdf/layout.blade.php @@ -3,7 +3,7 @@ - + STERN TOURS @@ -26,7 +26,7 @@ 10719 Berlin
    - Fon: 030 | 88 0 313 0
    + Tel.: 030 | 88 0 313 0
    Fax: 030 | 88 0 313 44
    E-Mail: kontakt@sterntours.de
    Web: www.sterntours.de diff --git a/resources/views/travel/user/booking/_detail_files.blade.php b/resources/views/travel/user/booking/_detail_files.blade.php index 56038d5..82352fd 100755 --- a/resources/views/travel/user/booking/_detail_files.blade.php +++ b/resources/views/travel/user/booking/_detail_files.blade.php @@ -19,7 +19,26 @@ - + @if($travel_user_booking_fewo->fewo_lodging) + + {{$booking_files_count++}} + + + {{\App\Services\BookingFewo::getFeWoInstructionPDFName($travel_user_booking_fewo->fewo_lodging)}} + + + + application/pdf + + - + + + + + + + @endif @foreach(\App\Services\BookingFewo::contentFiles() as $content_file) @if($file = \App\Models\CMSContent::getModelBySlug($content_file)) diff --git a/resources/views/travel/user/booking/_detail_info.blade.php b/resources/views/travel/user/booking/_detail_info.blade.php index 1686a57..6d35233 100755 --- a/resources/views/travel/user/booking/_detail_info.blade.php +++ b/resources/views/travel/user/booking/_detail_info.blade.php @@ -3,7 +3,7 @@ -
    +
    diff --git a/resources/views/travel/user/booking/mail/modal-new-booking-files.blade.php b/resources/views/travel/user/booking/mail/modal-new-booking-files.blade.php index f067d46..5deb9af 100644 --- a/resources/views/travel/user/booking/mail/modal-new-booking-files.blade.php +++ b/resources/views/travel/user/booking/mail/modal-new-booking-files.blade.php @@ -12,6 +12,27 @@ @php($booking_files_count = 1) + @if($booking->fewo_lodging) + + {{$booking_files_count++}} + + + {{\App\Services\BookingFewo::getFeWoInstructionPDFName($booking->fewo_lodging)}} + + + + application/pdf + + - + + + + + @endif + @foreach(\App\Services\BookingFewo::contentFiles() as $content_file) @if($file = \App\Models\CMSContent::getModelBySlug($content_file)) diff --git a/routes/web.php b/routes/web.php index 9d6df1c..107c83c 100755 --- a/routes/web.php +++ b/routes/web.php @@ -249,11 +249,21 @@ Route::group(['middleware' => ['admin']], function() Route::get('/cms/travel_guide/page/detail/{id}', 'CMS\CMSTravelGuideControllecr@pageDetail')->name('cms_travel_guide_page_detail'); Route::post('/cms/travel_guide/page/detail/{id}', 'CMS\CMSTravelGuideController@pageStore')->name('cms_travel_guide_page_detail'); - Route::get('/cms/travel_guide/detail/{id}', 'CMS\CMSTravelGuideController@detail')->name('cms_travel_guide_detail'); Route::post('/cms/travel_guide/detail/{id}', 'CMS\CMSTravelGuideController@store')->name('cms_travel_guide_detail'); Route::get('/cms/travel_guide/delete/{id}', 'CMS\CMSTravelGuideController@delete')->name('cms_travel_guide_delete'); }); + Route::group(['middleware' => ['auth.permission:cms-tg']], function() { + // CMS FeWo + Route::get('/cms/fewo/all/{step?}', 'CMS\CMSFeWoController@all')->name('cms_fewo_all'); + Route::post('/cms/fewo/all/{step?}', 'CMS\CMSFeWoController@storeAll')->name('cms_fewo_all'); + Route::get('/cms/fewo/all/delete/{id}', 'CMS\CMSFeWoController@deleteAll')->name('cms_fewo_all_delete'); + + Route::get('/cms/fewo/content', 'CMS\CMSFeWoController@content')->name('cms_fewo_content'); + Route::get('/cms/fewo/content/detail/{id}/{step?}', 'CMS\CMSFeWoController@detail')->name('cms_fewo_content_detail'); + Route::post('/cms/fewo/content/detail/{id}/{step?}', 'CMS\CMSFeWoController@store')->name('cms_fewo_content_store'); + + }); Route::group(['middleware' => ['auth.permission:cms-fb']], function() { // CMS Feedback Route::get('/cms/feedback', 'CMS\CMSFeedbackController@index')->name('cms_feedback'); diff --git a/storage/app/booking_fewo/files/2020/06/5ef9ab45db7800.71530766_ust111.pdf b/storage/app/booking_fewo/files/2020/06/5ef9ab45db7800.71530766_ust111.pdf new file mode 100644 index 0000000..9c22f8d Binary files /dev/null and b/storage/app/booking_fewo/files/2020/06/5ef9ab45db7800.71530766_ust111.pdf differ diff --git a/storage/app/travel_user/attachment/2020/06/5ef9b97a102445.36057834_hinweise-ferienwohnung-strandstra.pdf b/storage/app/travel_user/attachment/2020/06/5ef9b97a102445.36057834_hinweise-ferienwohnung-strandstra.pdf new file mode 100644 index 0000000..8aba8ca Binary files /dev/null and b/storage/app/travel_user/attachment/2020/06/5ef9b97a102445.36057834_hinweise-ferienwohnung-strandstra.pdf differ diff --git a/storage/app/travel_user/attachment/2020/06/5ef9b98209a9e6.83093277_hinweise-ferienwohnung-strandstra.pdf b/storage/app/travel_user/attachment/2020/06/5ef9b98209a9e6.83093277_hinweise-ferienwohnung-strandstra.pdf new file mode 100644 index 0000000..471209a Binary files /dev/null and b/storage/app/travel_user/attachment/2020/06/5ef9b98209a9e6.83093277_hinweise-ferienwohnung-strandstra.pdf differ