Fewo Mails / Booking Country Services
This commit is contained in:
parent
b9c26d06d0
commit
48a6eb2282
154 changed files with 7761 additions and 1643 deletions
|
|
@ -273,7 +273,6 @@ class ReportController extends Controller
|
|||
|
||||
private function prozessProvidersSearch(){
|
||||
|
||||
|
||||
$query = ServiceProviderEntry::with('booking', 'service_provider', 'booking.customer')->select('service_provider_entry.*');
|
||||
if(Request::get('filter_is_cleared') != ""){
|
||||
$query->where('is_cleared', '=', Request::get('filter_is_cleared'));
|
||||
|
|
@ -293,8 +292,6 @@ class ReportController extends Controller
|
|||
$q->where("start_date", '<=', $travel_date_to);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,9 +55,15 @@ class BookingController extends Controller
|
|||
{
|
||||
// \Session()->flash('alert-save', '1');
|
||||
|
||||
|
||||
$data = Request::all();
|
||||
if($id == "new") {
|
||||
|
||||
if($data['action'] === 'update_booking'){
|
||||
$booking = $this->bookingRepo->updateBooking($id, $data);
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('booking_detail', [$booking->id])."#collapseBookingBooking");
|
||||
}
|
||||
|
||||
if($id === "new") {
|
||||
$booking = new Booking();
|
||||
}else{
|
||||
$booking = Booking::findOrFail($id);
|
||||
|
|
@ -244,6 +250,27 @@ class BookingController extends Controller
|
|||
}
|
||||
|
||||
|
||||
public function delete($id, $del="booking"){
|
||||
|
||||
if($del === 'booking') {
|
||||
//$model = Booking::findOrFail($id);
|
||||
//$model->delete();
|
||||
\Session()->flash('alert-success', __('Buchung gelöscht sowie die Reservierung im Sterntrous Kalender'));
|
||||
}
|
||||
if($del === 'booking_file'){
|
||||
$booking_file = BookingFile::findOrFail($id);
|
||||
$booking = $booking_file->booking;
|
||||
$fileRepo = new BookingFileRepository($booking_file);
|
||||
$fileRepo->_set('disk', 'booking');
|
||||
$fileRepo->delete();
|
||||
$booking_file->delete();
|
||||
\Session()->flash('alert-success', 'Datei gelöscht');
|
||||
return redirect(route('booking_detail', [$booking->id]));
|
||||
}
|
||||
return redirect(route('requests'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,12 @@ use Validator;
|
|||
class CMSContentController extends Controller
|
||||
{
|
||||
|
||||
protected $identifier_content;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->identifier_content = 'general';
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -21,7 +25,8 @@ class CMSContentController extends Controller
|
|||
public function index()
|
||||
{
|
||||
$data = [
|
||||
'contents' => CMSContent::all()->sortByDesc('id')
|
||||
'contents' => CMSContent::where('identifier', '=', $this->identifier_content)->get()->sortByDesc('id'),
|
||||
'identifier_content' => $this->identifier_content,
|
||||
];
|
||||
return view('cms.content.all.index', $data);
|
||||
}
|
||||
|
|
@ -30,18 +35,17 @@ class CMSContentController extends Controller
|
|||
public function store()
|
||||
{
|
||||
$data = Request::all();
|
||||
|
||||
if(Request::ajax()) {
|
||||
//upload file
|
||||
if($data['file']){
|
||||
$cmsFileRepo = new CMSFileRepository(new CMSContent());
|
||||
$cmsFileRepo->_set('data', $data);
|
||||
$cmsFileRepo->_set('disk', 'public');
|
||||
$cmsFileRepo->_set('dir', '/cms_files/'.date('Y/m').'/');
|
||||
$cmsFileRepo->_set('identifier', 'cms_file');
|
||||
return $cmsFileRepo->uploadFile(Request::all());
|
||||
}
|
||||
return response()->json(['response' => $data, 'html'=>""]);
|
||||
|
||||
}
|
||||
$rules = array(
|
||||
'name' => 'required',
|
||||
|
|
@ -68,6 +72,10 @@ class CMSContentController extends Controller
|
|||
|
||||
}
|
||||
\Session()->flash('alert-save', '1');
|
||||
if(isset($data['back'])){
|
||||
return redirect($data['back']);
|
||||
|
||||
}
|
||||
return redirect(route('cms_content_all'));
|
||||
}
|
||||
|
||||
|
|
@ -78,9 +86,11 @@ class CMSContentController extends Controller
|
|||
$data = Request::all();
|
||||
$returnHTML = "";
|
||||
if(isset($data['model']) && isset($data['id']) ){
|
||||
if($data['model'] == 'content'){
|
||||
if($data['id'] == "new"){
|
||||
if($data['model'] === 'content'){
|
||||
if($data['id'] === "new"){
|
||||
$value = new CMSContent();
|
||||
$value->identifier = $data['identifier'];
|
||||
$value->field = isset($data['field']) ? $data['field'] : null;
|
||||
}else {
|
||||
$value = CMSContent::find($data['id']);
|
||||
}
|
||||
|
|
@ -93,19 +103,16 @@ class CMSContentController extends Controller
|
|||
|
||||
//public
|
||||
|
||||
|
||||
public function delete($id){
|
||||
$content = CMSContent::findOrFail($id);
|
||||
if($content->isFile()){
|
||||
$content->deleteFile();
|
||||
}
|
||||
$content->delete();
|
||||
$m = \App\Models\Sym\CmsContent::find($id);
|
||||
$m->delete();
|
||||
\Session()->flash('alert-success', __('Content gelöscht'));
|
||||
return redirect(route('cms_content_all'));
|
||||
return back(); //redirect(route('cms_content_all'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
383
app/Http/Controllers/CustomerFewoMailController.php
Executable file
383
app/Http/Controllers/CustomerFewoMailController.php
Executable file
|
|
@ -0,0 +1,383 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\CustomerFewoFile;
|
||||
use App\Models\CustomerFewoMail;
|
||||
use App\Models\EmailTemplate;
|
||||
use App\Models\TravelUserBookingFewo;
|
||||
use App\Models\TravelUserBookingFile;
|
||||
use App\Repositories\BookingFewoFileRepository;
|
||||
use App\Repositories\CustomerFewoFileRepository;
|
||||
use App\Repositories\CustomerFewoMailRepository;
|
||||
use App\Services\Util;
|
||||
use Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Request;
|
||||
use Response;
|
||||
|
||||
class CustomerFewoMailController extends Controller
|
||||
{
|
||||
|
||||
protected $customerMailRepo;
|
||||
|
||||
public function __construct(CustomerFewoMailRepository $customerMailRepo)
|
||||
{
|
||||
$this->middleware('admin');
|
||||
$this->customerMailRepo = $customerMailRepo;
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = [
|
||||
|
||||
];
|
||||
return view('customer.mail.index', $data);
|
||||
}
|
||||
|
||||
public function detail($id)
|
||||
{
|
||||
if($id === "new") {
|
||||
$customer_mail = new CustomerFewoMail();
|
||||
$id = 'new';
|
||||
|
||||
}else{
|
||||
$customer_mail = CustomerFewoMail::findOrFail($id);
|
||||
$id = $customer_mail->id;
|
||||
}
|
||||
|
||||
|
||||
$data = [
|
||||
'customer_mail' => $customer_mail,
|
||||
'id' => $id,
|
||||
'back' => URL::previous(),
|
||||
];
|
||||
return view('customer.mail.detail', $data);
|
||||
|
||||
}
|
||||
|
||||
public function store($id, $action=false)
|
||||
{
|
||||
$data = Request::all();
|
||||
$customer_mail = CustomerFewoMail::findOrFail($id);
|
||||
|
||||
if($action === 'move-mail'){
|
||||
$data['subdir'] = isset($data['subdir']) && $data['subdir'] ? $data['subdir'] : null;
|
||||
$customer_mail->dir = $data['dir'];
|
||||
$customer_mail->subdir = $data['subdir'];
|
||||
$customer_mail->save();
|
||||
|
||||
}
|
||||
return back();
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
$customer_mail = CustomerFewoMail::find($id);
|
||||
$customer_mail->dir = 12;
|
||||
$customer_mail->subdir = 0;
|
||||
$customer_mail->save();
|
||||
|
||||
\Session()->flash('alert-success', __('Mail gelöscht'));
|
||||
return back();
|
||||
}
|
||||
|
||||
|
||||
public function loadModal(){
|
||||
$data = Request::all();
|
||||
$ret = "";
|
||||
if(Request::ajax()) {
|
||||
if ($data['action'] === "new-customer-mail" || $data['action'] === "reply-customer-mail" || $data['action'] === "show-customer-mail" || $data['action'] === "edit-customer-mail"){
|
||||
$data['customers'] = [];
|
||||
if ($data['action'] === "new-customer-mail" && isset($data['travel_user_booking_fewo_id']) && $TravelUserBookingFewo = TravelUserBookingFewo::find($data['travel_user_booking_fewo_id'])) {
|
||||
$tmp = [];
|
||||
$tmp['email'] = $TravelUserBookingFewo->travel_user ? $TravelUserBookingFewo->travel_user->email : "";
|
||||
$tmp['name'] = $TravelUserBookingFewo->travel_user ? $TravelUserBookingFewo->travel_user->first_name . " " . $TravelUserBookingFewo->travel_user->last_name . " | " : "- | ";
|
||||
$tmp['name'] .= $TravelUserBookingFewo->fewo_lodging_id ? $TravelUserBookingFewo->fewo_lodging->name . " | " : "- | ";
|
||||
$data['customers'][$TravelUserBookingFewo->id] = $tmp;
|
||||
}
|
||||
$ret = CustomerFewoMailRepository::loadModal($data);
|
||||
}
|
||||
|
||||
if($data['action'] === "modal-upload-booking-file") {
|
||||
$ret = view("travel.user.booking.upload_modal", compact('data'))->render();
|
||||
}
|
||||
|
||||
if($data['action'] === "upload-booking-file"){
|
||||
if($data['travel_user_booking_fewo_id']){
|
||||
$bookingFileRepo = new BookingFewoFileRepository(new TravelUserBookingFile());
|
||||
$bookingFileRepo->_set('disk', 'booking_fewo');
|
||||
$bookingFileRepo->_set('travel_user_booking_fewo_id', $data['travel_user_booking_fewo_id']);
|
||||
$bookingFileRepo->_set('dir', '/files/'.date('Y/m').'/');
|
||||
$bookingFileRepo->_set('identifier', 'booking');
|
||||
return $bookingFileRepo->uploadFile(Request::all());
|
||||
}
|
||||
}
|
||||
}
|
||||
return response()->json(['response' => $data, 'html'=>$ret]);
|
||||
}
|
||||
|
||||
|
||||
public function sendMail(CustomerFewoMailRepository $customerFewoMailRepository){
|
||||
$data = Request::all();
|
||||
$customerFewoMailRepository->sendAndStore($data);
|
||||
if($data['action'] == 'draft'){
|
||||
\Session()->flash('alert-success', "Entwurf gespeichert!");
|
||||
}else{
|
||||
\Session()->flash('alert-success', "Mail gesendet!");
|
||||
}
|
||||
return back();
|
||||
}
|
||||
|
||||
public function replyMail(CustomerFewoMailRepository $customerFewoMailRepository){
|
||||
$data = Request::all();
|
||||
$customerFewoMailRepository->replyStore($data);
|
||||
\Session()->flash('alert-success', "Mail gespeichert!");
|
||||
return back();
|
||||
}
|
||||
|
||||
/*public function getCustomerFewoMails()
|
||||
{
|
||||
$query = CustomerFewoMail::with('booking')->with('customer')->select('customer_mails.*');
|
||||
|
||||
return \DataTables::eloquent($query)
|
||||
->addColumn('action_edit', function (CustomerFewoMail $customer_mail) {
|
||||
return '<a href="'.route('customer_mail_detail', [$customer_mail->id]).'" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
|
||||
})
|
||||
->addColumn('id', function (CustomerFewoMail $customer_mail) {
|
||||
return '<a data-order="'.$customer_mail->id.'" href="'.route('customer_mail_detail', [$customer_mail->id]).'" data-id="'.$customer_mail->id.'">'.$customer_mail->id.'</a>';
|
||||
})
|
||||
->addColumn('booking', function (CustomerFewoMail $customer_mail) {
|
||||
$out = $customer_mail->booking->travel_country_id ? $customer_mail->booking->travel_country->name." | " : "- | ";
|
||||
$out .= $customer_mail->booking->travelagenda_id ? $customer_mail->booking->travel_agenda->name."" : "-";
|
||||
return $out;
|
||||
})
|
||||
->addColumn('travel_user_booking_fewo_id', function (CustomerFewoMail $customer_mail) {
|
||||
return '<a data-order="'.$customer_mail->travel_user_booking_fewo_id.'" href="'.route('booking_detail', [$customer_mail->travel_user_booking_fewo_id]).'">'.$customer_mail->travel_user_booking_fewo_id.'</a>';
|
||||
})
|
||||
->addColumn('customer_id', function (CustomerFewoMail $customer_mail) {
|
||||
return '<a data-order="'.$customer_mail->customer_id.'" href="'.route('customer_detail', [$customer_mail->customer_id]).'">'.$customer_mail->customer_id.'</a>';
|
||||
})
|
||||
->addColumn('send', function (CustomerFewoMail $customer_mail) {
|
||||
return $customer_mail->send ? '<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
|
||||
})
|
||||
->orderColumn('id', 'id $1')
|
||||
->orderColumn('travel_user_booking_fewo_id', 'travel_user_booking_fewo_id $1')
|
||||
->orderColumn('customer_id', 'customer_id $1')
|
||||
->orderColumn('send', 'send $1')
|
||||
|
||||
->filterColumn('id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('id', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('customer_id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('customer_id', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('travel_user_booking_fewo_id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('travel_user_booking_fewo_id', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->rawColumns(['action_edit', 'send', 'customer_id', 'travel_user_booking_fewo_id', 'id'])
|
||||
->make(true);
|
||||
}*/
|
||||
|
||||
public function getEmailTemplates()
|
||||
{
|
||||
$query = EmailTemplate::with('email_template_dir')->select('email_templates.*')->where('active', '=', true);
|
||||
|
||||
if(Request::get('filter_email_templates_directory') != ""){
|
||||
$query->where('email_template_dir_id', '=', Request::get('filter_email_templates_directory'));
|
||||
}
|
||||
|
||||
return \DataTables::eloquent($query)
|
||||
->addColumn('action', function (EmailTemplate $emailTemplate) {
|
||||
return '<a href="javascript:void(0)" class="btn icon-btn btn-sm btn-primary email-template-action"
|
||||
data-url="'.route('customer_mail_ajax').'" data-id="'.$emailTemplate->id.'" data-action="load_email_template"
|
||||
title="Vorlage laden" data-placement="left" rel="tooltip"><span class="ion ion-ios-arrow-dropup"></span></a>';
|
||||
})
|
||||
->addColumn('email_template_dir.name', function (EmailTemplate $emailTemplate) {
|
||||
return $emailTemplate->email_template_dir ? '<span class="badge badge-default" style="background-color: '.$emailTemplate->email_template_dir->color.'">'.$emailTemplate->email_template_dir->name.'</span>' : ' ';
|
||||
})
|
||||
->orderColumn('id', 'id $1')
|
||||
->orderColumn('subject', 'subject $1')
|
||||
->orderColumn('name', 'name $1')
|
||||
->orderColumn('email_template_dir.name', 'email_template_dir.name $1')
|
||||
->orderColumn('message', 'message $1')
|
||||
->filterColumn('id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('id', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('subject', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('name', 'LIKE', '%'.$keyword.'%');
|
||||
$query->OrWhere('subject', 'LIKE', '%'.$keyword.'%');
|
||||
$query->OrWhere('message', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->rawColumns(['action', 'email_template_dir.name'])
|
||||
->make(true);
|
||||
}
|
||||
|
||||
|
||||
public function uploadAttachment($id){
|
||||
|
||||
$fileRepo = new CustomerFewoFileRepository(new CustomerFewoFile());
|
||||
if($id === 'tmp'){
|
||||
$fileRepo->_set('disk', 'travel_user');
|
||||
$fileRepo->_set('dir', '/attachment/'.date('Y/m').'/');
|
||||
$fileRepo->_set('travel_user_id', NULL);
|
||||
$fileRepo->_set('customer_fewo_mail_id', NULL);
|
||||
$fileRepo->_set('identifier', 'tmp');
|
||||
return $fileRepo->uploadFile(Request::all());
|
||||
}
|
||||
|
||||
return Response::json([
|
||||
'error' => true,
|
||||
'code' => 200
|
||||
], 200);
|
||||
}
|
||||
|
||||
public function ajax(){
|
||||
$data = Request::all();
|
||||
$ret = "";
|
||||
$status = false;
|
||||
if(Request::ajax()){
|
||||
if($data['action'] === 'toggle_important'){
|
||||
$customer_mail = CustomerFewoMail::find($data['id']);
|
||||
$customer_mail->important = ($customer_mail->important ? false : true);
|
||||
$customer_mail->save();
|
||||
$status = 'success';
|
||||
}
|
||||
if($data['action'] === 'load_email_template'){
|
||||
$email_template = EmailTemplate::find($data['id']);
|
||||
$ret = $email_template->message;
|
||||
$data['subject'] = $email_template->subject;
|
||||
$status = 'success';
|
||||
}
|
||||
if($data['action'] === 'delete_mail_attachment'){
|
||||
$customer_file = CustomerFewoFile::find($data['id']);
|
||||
$fileRepo = new CustomerFewoFileRepository($customer_file);
|
||||
$fileRepo->_set('disk', 'travel_user');
|
||||
$ret = $fileRepo->delete();
|
||||
$status = 'success';
|
||||
}
|
||||
|
||||
if($data['action'] === 'add_attachment'){
|
||||
$arrContextOptions=array(
|
||||
"ssl"=>array(
|
||||
"verify_peer"=>false,
|
||||
"verify_peer_name"=>false,
|
||||
),
|
||||
);
|
||||
$contents = file_get_contents($data['target'], false, stream_context_create($arrContextOptions));
|
||||
$mine = Util::getMimeFromHeader($http_response_header);
|
||||
$extension = Util::getExtensionFromMime($mine);
|
||||
$fileRepo = new CustomerFewoFileRepository(new CustomerFewoFile());
|
||||
$fileRepo->_set('disk', 'travel_user');
|
||||
$fileRepo->_set('dir', '/attachment/'.date('Y/m').'/');
|
||||
$fileRepo->_set('travel_user_id', NULL);
|
||||
$fileRepo->_set('customer_fewo_mail_id', NULL);
|
||||
$fileRepo->_set('identifier', 'tmp');
|
||||
$fileRepo->_set('originalName', $data['name']);
|
||||
$fileRepo->_set('mine', $mine);
|
||||
$fileRepo->_set('extension', $extension);
|
||||
return $fileRepo->storeFile($contents);
|
||||
}
|
||||
}
|
||||
return response()->json(['response' => $data, 'html'=>$ret, 'status'=>$status]);
|
||||
}
|
||||
|
||||
private function getSearchRequests()
|
||||
{
|
||||
if (!Request::get('travel_user_booking_fewo_id')) {
|
||||
return false;
|
||||
}
|
||||
$query = CustomerFewoMail::where('travel_user_booking_fewo_id', '=', Request::get('travel_user_booking_fewo_id'));
|
||||
if (Request::get('customer_mail_dir') == 11) { //draft
|
||||
$query->where('draft', '=', true)->where('dir', '!=', 12);
|
||||
}else{
|
||||
$query->where('dir', '=', Request::get('customer_mail_dir')); //with('lead'
|
||||
}
|
||||
if (Request::get('customer_mail_subdir')) {
|
||||
$query->where('subdir', '=', Request::get('customer_mail_subdir'));
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function getRequests(){
|
||||
|
||||
$query = $this->getSearchRequests();
|
||||
return \DataTables::eloquent($query)
|
||||
->addColumn('checkbox', function (CustomerFewoMail $customer_mail) {
|
||||
return '<div class="message-checkbox mr-1">
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input">
|
||||
<span class="custom-control-label"></span>
|
||||
</label>
|
||||
</div>';
|
||||
})
|
||||
->addColumn('important', function (CustomerFewoMail $customer_mail) {
|
||||
$icon = ($customer_mail->important ? 'ion-md-star' : 'ion-md-star-outline');
|
||||
return '<a href="javascript:void(0)" class="ion '.$icon.' d-block text-secondary text-big mr-3 customer-mail-ajax-action"
|
||||
data-url="'.route('customer_fewo_mail_ajax').'" data-id="'.$customer_mail->id.'" data-important="'.$customer_mail->important.'" data-action="toggle_important"></a>';
|
||||
})
|
||||
->addColumn('subject', function (CustomerFewoMail $customer_mail) {
|
||||
|
||||
$icon = $customer_mail->reply_id ? 'ion-ios-redo' : 'ion-ios-mail';
|
||||
$badge = $customer_mail->is_answer ? 'badge-next' : 'badge-secondary';
|
||||
$badge = $customer_mail->draft ? 'badge-default' : $badge;
|
||||
$to_icon = $customer_mail->draft ? '<i class="ion ion-ios-warning" style="opacity: 0.7"></i>' : '';
|
||||
$action = $customer_mail->draft ? 'edit-customer-mail' : 'show-customer-mail';
|
||||
$id = $customer_mail->draft ? $customer_mail->id : 'new';
|
||||
$url = $customer_mail->draft ? route('customer_fewo_mail_send_mail') : '';
|
||||
|
||||
return '<a href="javascript:void(0)" class="badge '.$badge.'" data-toggle="modal"
|
||||
data-target="#modals-load-content" data-id="'.$id.'" data-model="CustomerFewoMail"
|
||||
data-action="'.$action.'" data-url="'.$url.'" data-redirect="back"
|
||||
data-customer_mail_id="'.$customer_mail->id.'" data-route="'.route('customer_fewo_modal_load').'">
|
||||
'.$to_icon.'<i class="ion '.$icon.' ui-w-30 text-center" style="opacity: 0.7"></i>'.$customer_mail->subject.'
|
||||
'.($customer_mail->customer_fewo_files->count() ? ' <i class="ion ion-md-attach"> <span class="badge badge-primary indicator">'.$customer_mail->customer_fewo_files->count().'</span></i>' : '');
|
||||
|
||||
})
|
||||
->addColumn('date', function (CustomerFewoMail $customer_mail) {
|
||||
if($customer_mail->send){
|
||||
return '<span class="badge badge-success" style="background-color: #94ae59"><i class="fa fa-check-circle"></i> '.$customer_mail->sent_at.'</span>';
|
||||
}
|
||||
return '<span class="badge badge-default"><i class="fa fa-times-circle"></i> '.$customer_mail->sent_at.'</span>';
|
||||
})
|
||||
->addColumn('action', function (CustomerFewoMail $customer_mail) {
|
||||
$ret = '';
|
||||
if(!$customer_mail->draft){
|
||||
$ret = '<a href="javascript:void(0)" class="btn btn-xs btn-secondary" data-toggle="modal"
|
||||
data-target="#modals-load-content" data-id="reply-send" data-model="customerMail" data-action="new-customer-mail"
|
||||
data-url="'.route('customer_fewo_mail_send_mail').'" data-redirect="back" data-customer_mail_id="'.$customer_mail->id.'"
|
||||
data-travel_user_booking_fewo_id="'.$customer_mail->travel_user_booking_fewo_id.'" data-route="'.route('customer_fewo_modal_load').'" data-customer_mail_dir="'.$customer_mail->dir.'" data-customer_subdir="'.$customer_mail->subdir.'">
|
||||
<span title="Antwort auf E-Mail senden" data-placement="left" rel="tooltip"><i class="ion ion-ios-redo"></i> <i class="ion ion-md-mail-open"></i></span>
|
||||
</a>
|
||||
|
||||
<a href="javascript:void(0)" class="btn btn-xs btn-default" data-toggle="modal"
|
||||
data-target="#modals-load-content" data-id="reply-save" data-model="customerMail" data-action="reply-customer-mail"
|
||||
data-url="'.route('customer_fewo_mail_reply_mail').'" data-redirect="back" data-customer_mail_id="'.$customer_mail->id.'"
|
||||
data-travel_user_booking_fewo_id="'.$customer_mail->travel_user_booking_fewo_id.'" data-route="'.route('customer_fewo_modal_load').'" data-customer_mail_dir="'.$customer_mail->dir.'" data-customer_mail_subdir="'.$customer_mail->subdir.'">
|
||||
<span title="Antwort auf E-Mail speichern" data-placement="left" rel="tooltip"><i class="ion ion-ios-redo"></i> <i class="ion ion-md-mail-unread"></i></span>
|
||||
</a>
|
||||
';
|
||||
}
|
||||
$ret .= '<a href="'.route('customer_fewo_mail_delete', [$customer_mail->id]).'" class="btn btn-xs btn-default text-danger" onclick="return confirm(\'In den Papierkorb verschieben?\');"><i class="ion ion-md-trash"></i></a>';
|
||||
return '<div style="white-space: nowrap;">'.$ret.'</div>';
|
||||
})
|
||||
|
||||
->orderColumn('date', 'sent_at $1')
|
||||
->orderColumn('subject', 'subject $1')
|
||||
->orderColumn('important', 'important $1')
|
||||
->rawColumns(['checkbox', 'important', 'subject', 'date', 'action'])
|
||||
->make(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Customer;
|
||||
use App\Models\CustomerFewoMail;
|
||||
use App\Models\CustomerFile;
|
||||
use App\Models\CustomerMail;
|
||||
use App\Models\EmailTemplate;
|
||||
|
|
@ -39,13 +40,10 @@ class CustomerMailController extends Controller
|
|||
if($id === "new") {
|
||||
$customer_mail = new CustomerMail();
|
||||
$id = 'new';
|
||||
|
||||
}else{
|
||||
$customer_mail = CustomerMail::findOrFail($id);
|
||||
$id = $customer_mail->id;
|
||||
}
|
||||
|
||||
|
||||
$data = [
|
||||
'customer_mail' => $customer_mail,
|
||||
'id' => $id,
|
||||
|
|
@ -58,23 +56,29 @@ class CustomerMailController extends Controller
|
|||
public function store($id, $action=false)
|
||||
{
|
||||
$data = Request::all();
|
||||
$customer_mail = CustomerMail::findOrFail($id);
|
||||
|
||||
if($action === 'move-mail'){
|
||||
$data['travel_country_id'] = isset($data['travel_country_id']) && $data['travel_country_id'] ? $data['travel_country_id'] : null;
|
||||
$customer_mail = CustomerMail::findOrFail($id);
|
||||
$data['subdir'] = isset($data['subdir']) && $data['subdir'] ? $data['subdir'] : null;
|
||||
$customer_mail->dir = $data['dir'];
|
||||
$customer_mail->travel_country_id = $data['travel_country_id'];
|
||||
$customer_mail->subdir = $data['subdir'];
|
||||
$customer_mail->save();
|
||||
|
||||
}
|
||||
if($action === 'move-mail-fewo'){
|
||||
$customer_mail = CustomerFewoMail::findOrFail($id);
|
||||
$data['subdir'] = isset($data['subdir']) && $data['subdir'] ? $data['subdir'] : null;
|
||||
$customer_mail->dir = $data['dir'];
|
||||
$customer_mail->subdir = $data['subdir'];
|
||||
$customer_mail->save();
|
||||
}
|
||||
return back();
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
$customer_mail = CustomerMail::find($id);
|
||||
$customer_mail->dir = 12;
|
||||
$customer_mail->travel_country_id = null;
|
||||
$customer_mail->draft = false;
|
||||
$customer_mail->subdir = 0;
|
||||
$customer_mail->save();
|
||||
|
||||
\Session()->flash('alert-success', __('Mail gelöscht'));
|
||||
|
|
@ -186,7 +190,11 @@ class CustomerMailController extends Controller
|
|||
|
||||
public function getEmailTemplates()
|
||||
{
|
||||
$query = EmailTemplate::where('active', '=', true);
|
||||
$query = EmailTemplate::with('email_template_dir')->select('email_templates.*')->where('active', '=', true);
|
||||
|
||||
if(Request::get('filter_email_templates_directory') != ""){
|
||||
$query->where('email_template_dir_id', '=', Request::get('filter_email_templates_directory'));
|
||||
}
|
||||
|
||||
return \DataTables::eloquent($query)
|
||||
->addColumn('action', function (EmailTemplate $emailTemplate) {
|
||||
|
|
@ -194,8 +202,12 @@ class CustomerMailController extends Controller
|
|||
data-url="'.route('customer_mail_ajax').'" data-id="'.$emailTemplate->id.'" data-action="load_email_template"
|
||||
title="Vorlage laden" data-placement="left" rel="tooltip"><span class="ion ion-ios-arrow-dropup"></span></a>';
|
||||
})
|
||||
->addColumn('email_template_dir.name', function (EmailTemplate $emailTemplate) {
|
||||
return $emailTemplate->email_template_dir ? '<span class="badge badge-default" style="background-color: '.$emailTemplate->email_template_dir->color.'">'.$emailTemplate->email_template_dir->name.'</span>' : ' ';
|
||||
})
|
||||
->orderColumn('id', 'id $1')
|
||||
->orderColumn('subject', 'subject $1')
|
||||
->orderColumn('email_template_dir.name', 'email_template_dir.name $1')
|
||||
->orderColumn('message', 'message $1')
|
||||
->filterColumn('id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
|
|
@ -204,17 +216,16 @@ class CustomerMailController extends Controller
|
|||
})
|
||||
->filterColumn('subject', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('subject', 'LIKE', '%'.$keyword.'%');
|
||||
$query->where('name', 'LIKE', '%'.$keyword.'%');
|
||||
$query->OrWhere('subject', 'LIKE', '%'.$keyword.'%');
|
||||
$query->OrWhere('message', 'LIKE', '%'.$keyword.'%');
|
||||
|
||||
}
|
||||
})
|
||||
->rawColumns(['action'])
|
||||
->rawColumns(['action', 'email_template_dir.name'])
|
||||
->make(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function uploadAttachment($id){
|
||||
|
||||
$fileRepo = new CustomerFileRepository(new CustomerFile());
|
||||
|
|
@ -290,13 +301,13 @@ class CustomerMailController extends Controller
|
|||
}
|
||||
$query = CustomerMail::where('booking_id', '=', Request::get('booking_id'));
|
||||
if (Request::get('customer_mail_dir') == 11) { //draft
|
||||
$query->where('draft', '=', true);
|
||||
$query->where('draft', '=', true)->where('dir', '!=', 12);
|
||||
}else{
|
||||
$query->where('dir', '=', Request::get('customer_mail_dir')); //with('lead'
|
||||
|
||||
}
|
||||
if (Request::get('customer_mail_country')) {
|
||||
$query->where('travel_country_id', '=', Request::get('customer_mail_country'));
|
||||
if (Request::get('customer_mail_subdir')) {
|
||||
$query->where('subdir', '=', Request::get('customer_mail_subdir'));
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
|
|
@ -348,14 +359,14 @@ class CustomerMailController extends Controller
|
|||
$ret = '<a href="javascript:void(0)" class="btn btn-xs btn-secondary" data-toggle="modal"
|
||||
data-target="#modals-load-content" data-id="reply-send" data-model="customerMail" data-action="new-customer-mail"
|
||||
data-url="'.route('customer_mail_send_mail').'" data-redirect="back" data-customer_mail_id="'.$customer_mail->id.'"
|
||||
data-booking_id="'.$customer_mail->booking_id.'" data-route="'.route('booking_modal_load').'" data-customer_mail_dir="'.$customer_mail->dir.'" data-customer_mail_country="'.$customer_mail->travel_country_id.'">
|
||||
data-booking_id="'.$customer_mail->booking_id.'" data-route="'.route('booking_modal_load').'" data-customer_mail_dir="'.$customer_mail->dir.'" data-customer_mail_subdir="'.$customer_mail->subdir.'">
|
||||
<span title="Antwort auf E-Mail senden" data-placement="left" rel="tooltip"><i class="ion ion-ios-redo"></i> <i class="ion ion-md-mail-open"></i></span>
|
||||
</a>
|
||||
|
||||
<a href="javascript:void(0)" class="btn btn-xs btn-default" data-toggle="modal"
|
||||
data-target="#modals-load-content" data-id="reply-save" data-model="customerMail" data-action="reply-customer-mail"
|
||||
data-url="'.route('customer_mail_reply_mail').'" data-redirect="back" data-customer_mail_id="'.$customer_mail->id.'"
|
||||
data-booking_id="'.$customer_mail->booking_id.'" data-route="'.route('booking_modal_load').'" data-customer_mail_dir="'.$customer_mail->dir.'" data-customer_mail_country="'.$customer_mail->travel_country_id.'">
|
||||
data-booking_id="'.$customer_mail->booking_id.'" data-route="'.route('booking_modal_load').'" data-customer_mail_dir="'.$customer_mail->dir.'" data-customer_mail_subdir="'.$customer_mail->subdir.'">
|
||||
<span title="Antwort auf E-Mail speichern" data-placement="left" rel="tooltip"><i class="ion ion-ios-redo"></i> <i class="ion ion-md-mail-unread"></i></span>
|
||||
</a>
|
||||
';
|
||||
|
|
@ -375,7 +386,7 @@ class CustomerMailController extends Controller
|
|||
/*->filterColumn('subject', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->whereRaw("subject LIKE ?", '%'.$keyword.'%');
|
||||
|
||||
|
||||
}
|
||||
})*/
|
||||
->orderColumn('date', 'sent_at $1')
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ namespace App\Http\Controllers;
|
|||
use App\Models\Draft;
|
||||
use App\Models\DraftItem;
|
||||
use App\Models\DraftType;
|
||||
use Request;
|
||||
|
||||
class DraftController extends Controller
|
||||
{
|
||||
|
|
@ -28,7 +29,7 @@ class DraftController extends Controller
|
|||
|
||||
public function detail($id)
|
||||
{
|
||||
if($id == "new") {
|
||||
if($id === "new") {
|
||||
$draft = new Draft();
|
||||
$draft->active = true;
|
||||
$id = 'new';
|
||||
|
|
@ -48,7 +49,7 @@ class DraftController extends Controller
|
|||
public function store($id)
|
||||
{
|
||||
$data = Request::all();
|
||||
if($id == "new") {
|
||||
if($id === "new") {
|
||||
$draft = new Draft();
|
||||
}else{
|
||||
$draft = Draft::findOrFail($id);
|
||||
|
|
@ -145,7 +146,7 @@ class DraftController extends Controller
|
|||
public function typeUpdate(){
|
||||
|
||||
$data = Request::all();
|
||||
if($data['id'] == "new"){
|
||||
if($data['id'] === "new"){
|
||||
$draft_type = DraftType::create([
|
||||
'name' => $data['name'],
|
||||
'active' => isset($data['active']) ? true : false,
|
||||
|
|
@ -158,8 +159,6 @@ class DraftController extends Controller
|
|||
$draft_type->active = isset($data['active']) ? true : false;
|
||||
$draft_type->color = $data['color'];
|
||||
$draft_type->pos = $data['pos'];
|
||||
|
||||
|
||||
$draft_type->save();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,11 @@ class FileController extends Controller
|
|||
$filename = $file->original_name;
|
||||
$path = $file->getPath();
|
||||
}
|
||||
if ($disk === 'travel_user'){
|
||||
$file = \App\Models\CustomerFewoFile::findOrFail($id);
|
||||
$filename = $file->original_name;
|
||||
$path = $file->getPath();
|
||||
}
|
||||
|
||||
if ($disk === 'booking'){
|
||||
$file = \App\Models\BookingFile::findOrFail($id);
|
||||
|
|
@ -34,6 +39,18 @@ class FileController extends Controller
|
|||
$path = $file->getPath();
|
||||
}
|
||||
|
||||
if ($disk === 'general'){
|
||||
$file = \App\Models\GeneralFile::findOrFail($id);
|
||||
$filename = $file->original_name;
|
||||
$path = $file->getPath();
|
||||
}
|
||||
|
||||
if ($disk === 'booking_fewo'){
|
||||
$file = \App\Models\TravelUserBookingFile::findOrFail($id);
|
||||
$filename = $file->original_name;
|
||||
$path = $file->getPath();
|
||||
}
|
||||
|
||||
if ($disk === 'cms_file'){
|
||||
$file = \App\Models\CMSContent::findOrFail($id);
|
||||
$filename = $file->name;
|
||||
|
|
|
|||
70
app/Http/Controllers/ModalController.php
Normal file
70
app/Http/Controllers/ModalController.php
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\GeneralFile;
|
||||
use App\Models\TravelCountry;
|
||||
use App\Models\TravelCountryService;
|
||||
use App\Repositories\GeneralFileRepository;
|
||||
use Request;
|
||||
|
||||
class ModalController extends Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
public function load(){
|
||||
$data = Request::all();
|
||||
$ret = "";
|
||||
$status = false;
|
||||
if(Request::ajax()){
|
||||
|
||||
if($data['action'] === "upload-travel_country-file"){
|
||||
if($value = TravelCountry::find($data['id'])){
|
||||
$generalFileRepo = new GeneralFileRepository(new GeneralFile());
|
||||
$generalFileRepo->_set('disk', 'general');
|
||||
$generalFileRepo->_set('travel_country_id', $data['id']);
|
||||
$generalFileRepo->_set('dir', '/'.date('Y/m').'/');
|
||||
$generalFileRepo->_set('identifier', 'travel_country');
|
||||
$generalFileRepo->_set('redirect', $data['back']);
|
||||
|
||||
return $generalFileRepo->uploadFile(Request::all());
|
||||
}
|
||||
}
|
||||
if($data['action'] === 'modal-upload-travel_country-file'){
|
||||
$data['action'] = 'upload-travel_country-file';
|
||||
$ret = view("admin.modal.upload", compact('data'))->render();
|
||||
}
|
||||
|
||||
if($data['action'] === 'modal-travel_country-services'){
|
||||
if($data['id'] === 'new'){
|
||||
$value = new TravelCountryService();
|
||||
$value->active = true;
|
||||
}else{
|
||||
$value = TravelCountryService::find($data['id']);
|
||||
}
|
||||
$ret = view("admin.modal.country-service", compact('data', 'value'))->render();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return response()->json(['response' => $data, 'html'=>$ret, 'status'=>$status]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* <button type="button" class="btn btn-sm btn-primary" data-toggle="modal"
|
||||
data-target="#modals-load-content"
|
||||
data-id="{{ $value->id }}"
|
||||
data-model="emailTemplate"
|
||||
data-action="modal-email-template"
|
||||
data-url=""
|
||||
data-redirect="back"
|
||||
data-route="{{ route('modal_load') }}"><span class="fa fa-edit"></span></button>*/
|
||||
|
|
@ -9,6 +9,7 @@ use App\Models\Status;
|
|||
use App\Models\Sym\TravelCountry;
|
||||
use App\Models\TravelAgenda;
|
||||
use App\Models\TravelCompany;
|
||||
use App\Models\TravelCountryService;
|
||||
use App\Repositories\CustomerMailRepository;
|
||||
use Carbon\Carbon;
|
||||
use Request;
|
||||
|
|
@ -79,7 +80,7 @@ class RequestController extends Controller
|
|||
*/
|
||||
private function getSearchRequests(){
|
||||
|
||||
$query = Booking::with('lead')->with('customer')->with('customer_mails')->select('booking.*')->where('lead_id', '!=', NULL);
|
||||
$query = Booking::with('lead')->with('customer')->with('customer_mails')->with('customer_mails')->select('booking.*')->where('lead_id', '!=', NULL);
|
||||
|
||||
if(Request::get('full_firstname_search') != ""){
|
||||
$query->whereHas('customer', function ($q) {
|
||||
|
|
@ -225,9 +226,33 @@ class RequestController extends Controller
|
|||
|
||||
public function getAjaxRequests(){
|
||||
|
||||
$query = $this->getSearchRequests();
|
||||
$ret = $query->get()->pluck('travelagenda_id', 'id')->unique()->toArray();
|
||||
return TravelAgenda::whereIn('id', $ret)->get()->pluck('name', 'id');
|
||||
$data = Request::all();
|
||||
|
||||
if(Request::ajax()) {
|
||||
if(isset($data['action']) && $data['action'] === "get_popover_booking_services") {
|
||||
$booking = Booking::findOrFail($data['booking_id']);
|
||||
$ret = "";
|
||||
|
||||
foreach($booking->travel_country->getContactLandsModels() as $TravelCountry){
|
||||
if($TravelCountry->stern_travel_country){
|
||||
foreach($TravelCountry->stern_travel_country->travel_country_services as $travel_country_service){
|
||||
$ret .= \App\Models\BookingCountryService::getStatus($travel_country_service->id, $booking->id) ?
|
||||
'<span class="badge badge-pill badge-success"><i class="fa fa-check"></i> '.$travel_country_service->name.'</span>' :
|
||||
'<span class="badge badge-pill badge-danger""><i class="fa fa-times"></i> '.$travel_country_service->name.'</span>';
|
||||
$ret .= '<br>';
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if($ret === ""){
|
||||
return 'keine Leistungen definiert';
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
$query = $this->getSearchRequests();
|
||||
$ret = $query->get()->pluck('travelagenda_id', 'id')->unique()->toArray();
|
||||
return TravelAgenda::whereIn('id', $ret)->get()->pluck('name', 'id');
|
||||
}
|
||||
}
|
||||
|
||||
public function loadModal(){
|
||||
|
|
@ -290,8 +315,13 @@ class RequestController extends Controller
|
|||
return $booking->getEndDateFormat();
|
||||
})
|
||||
->addColumn('travel_documents', function (Booking $booking) {
|
||||
return $booking->travel_documents ? ' <span data-order="1" class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span data-order="0" class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
|
||||
return $booking->travel_documents ? '<span data-order="1" class="badge badge-pill badge-success" title="Reiseunterlagen" data-placement="top" rel="tooltip"><i class="fa fa-check"></i></span>' : '<span data-order="0" class="badge badge-pill badge-danger" title="Reiseunterlagen" data-placement="top" rel="tooltip"><i class="fa fa-times"></i></span>';
|
||||
})
|
||||
->addColumn('booking_country_services', function (Booking $booking) {
|
||||
return $booking->hasBookingCountryServicesUnchecked() ? '<span data-order="1" class="badge badge-pill badge-success" data-booking_id="'.$booking->id.'" data-placement="top" data-toggle="popover" title="Reise-, Agenturleistungen"><i class="fa fa-check"></i></span>' :
|
||||
'<span data-order="0" class="badge badge-pill badge-danger" data-booking_id="'.$booking->id.'" data-placement="top" data-toggle="popover" title="Reise-, Agenturleistungen"><i class="fa fa-times"></i></span>';
|
||||
})
|
||||
|
||||
->addColumn('sf_guard_user_id', function (Booking $booking) {
|
||||
return '<span data-order="'.($booking->sf_guard_user_id ? $booking->sf_guard_user_id : 0).'">'.($booking->sf_guard_user_id? $booking->sf_guard_user->first_name." ".$booking->sf_guard_user->last_name : "-").'</span>';
|
||||
})
|
||||
|
|
@ -312,7 +342,6 @@ class RequestController extends Controller
|
|||
if($booking->lawyer_date){
|
||||
return '<span data-order="'.$booking->lead->status_id.'"><span class="badge badge-dark" style="background-color: '.$color.'">'.$icon.$booking->lawyer_date->format('d.m.Y').'</span></span>';
|
||||
}
|
||||
|
||||
}
|
||||
return '<span data-order="'.$booking->lead->status_id.'"><span class="badge badge-dark" style="background-color: '.$color.'">'.$icon.$booking->lead->status->name.'</span></span>';
|
||||
}
|
||||
|
|
@ -348,7 +377,7 @@ class RequestController extends Controller
|
|||
return '<span data-order="'.$booking->refund_date.'"><span class="badge badge-'.$booking->getRefundColor().'">'.$booking->getRefundTypeList().'</span></span>';
|
||||
})
|
||||
->addColumn('hold', function (Booking $booking) {
|
||||
return $booking->hold ? ' <span data-order="1" class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span data-order="0" class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
|
||||
return $booking->hold ? ' <span data-order="1" class="badge badge-pill badge-success" title="Hold" data-placement="top" rel="tooltip"><i class="fa fa-check"></i></span>' : '<span data-order="0" class="badge badge-pill badge-danger" title="Hold" data-placement="top" rel="tooltip"><i class="fa fa-times"></i></span>';
|
||||
})
|
||||
->addColumn('xx_tkt', function (Booking $booking) {
|
||||
return '<span data-order="'.$booking->xx_tkt_date.'"><span class="badge badge-'.$booking->getXxTktColor().'">'.$booking->getXxTktTypeList().'</span></span>';
|
||||
|
|
@ -391,8 +420,8 @@ class RequestController extends Controller
|
|||
->orderColumn('airline_id', 'airline_id $1')
|
||||
->orderColumn('hold', 'hold $1')
|
||||
->orderColumn('xx_tkt', 'xx_tkt_date $1')
|
||||
->orderColumn('travel_documents', 'travel_documents $1')
|
||||
->rawColumns(['action_lead_edit', 'lead_id', 'participant_firstname', 'participant_name', 'action_booking_edit', 'travel_country_id', 'travelagenda_id', 'travel_company_id', 'sf_guard_user_id', 'lead.status_id', 'last_customer_email', 'id', 'travel_documents', 'paying_out', 'paying_out_status', 'airline_id', 'refund', 'hold', 'xx_tkt'])
|
||||
//->orderColumn('travel_documents', 'travel_documents $1')
|
||||
->rawColumns(['action_lead_edit', 'lead_id', 'participant_firstname', 'participant_name', 'action_booking_edit', 'travel_country_id', 'travelagenda_id', 'travel_company_id', 'sf_guard_user_id', 'lead.status_id', 'last_customer_email', 'id', 'travel_documents', 'booking_country_services', 'paying_out', 'paying_out_status', 'airline_id', 'refund', 'hold', 'xx_tkt'])
|
||||
->make(true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,75 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Settings;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Models\EmailTemplate;
|
||||
use Request;
|
||||
|
||||
class EmailTemplateController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('admin');
|
||||
}
|
||||
|
||||
|
||||
public function index($step = false)
|
||||
{
|
||||
$data = [
|
||||
'email_template' => EmailTemplate::all(),
|
||||
];
|
||||
return view('settings.email_template.index', $data);
|
||||
}
|
||||
|
||||
public function load(){
|
||||
$data = Request::all();
|
||||
$ret = "";
|
||||
if(Request::ajax()) {
|
||||
|
||||
if($data['action'] === "modal-email-template") {
|
||||
if($data['id'] === 'new'){
|
||||
$value = new EmailTemplate();
|
||||
$value->id = 0;
|
||||
$value->active = 1;
|
||||
|
||||
}else{
|
||||
$value = EmailTemplate::find($data['id']);
|
||||
|
||||
}
|
||||
$ret = view("settings.email_template.modal", compact('value'))->render();
|
||||
}
|
||||
}
|
||||
return response()->json(['response' => $data, 'html'=>$ret]);
|
||||
}
|
||||
|
||||
public function update(){
|
||||
|
||||
$data = Request::all();
|
||||
$data['active'] = isset($data['active']) ? true : false;
|
||||
|
||||
if($data['id'] === "new" || $data['id'] == 0){
|
||||
$model = EmailTemplate::create($data);
|
||||
}else{
|
||||
$model = EmailTemplate::find($data['id']);
|
||||
$model->fill($data);
|
||||
$model->save();
|
||||
}
|
||||
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('admin_settings_email_template'));
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
|
||||
$model = EmailTemplate::findOrFail($id);
|
||||
$model->delete();
|
||||
\Session()->flash('alert-success', 'Eintrag gelöscht');
|
||||
return redirect()->back();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
143
app/Http/Controllers/Settings/EmailsController.php
Executable file
143
app/Http/Controllers/Settings/EmailsController.php
Executable file
|
|
@ -0,0 +1,143 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Settings;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Models\CMSContent;
|
||||
use App\Models\EmailTemplate;
|
||||
use App\Models\EmailTemplateDir;
|
||||
use App\Services\Booking;
|
||||
use App\Services\BookingFewo;
|
||||
use App\Services\Util;
|
||||
use Request;
|
||||
|
||||
class EmailsController extends Controller
|
||||
{
|
||||
|
||||
protected $identifier_booking_file;
|
||||
protected $identifier_fewo_file;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->identifier_booking_file = 'booking-email-file';
|
||||
$this->identifier_fewo_file = 'fewo-email-file';
|
||||
$this->middleware('admin');
|
||||
}
|
||||
|
||||
|
||||
public function index($step = false)
|
||||
{
|
||||
|
||||
$data = [
|
||||
'email_template' => EmailTemplate::all(),
|
||||
'email_template_dirs' => EmailTemplateDir::all(),
|
||||
'booking_email_files' => CMSContent::where('identifier', '=', $this->identifier_booking_file)->get()->sortByDesc('pos'),
|
||||
'customer_mail_dirs' => Booking::getCustomerMailDirs(),
|
||||
'identifier_booking_file' => $this->identifier_booking_file,
|
||||
'identifier_fewo_file' => $this->identifier_fewo_file,
|
||||
'fewo_email_files' => CMSContent::where('identifier', '=', $this->identifier_fewo_file)->get()->sortByDesc('pos'),
|
||||
'customer_fewo_mail_dirs' => BookingFewo::getCustomerMailDirs(),
|
||||
'step' => $step
|
||||
|
||||
];
|
||||
return view('settings.emails.index', $data);
|
||||
}
|
||||
|
||||
public function load(){
|
||||
$data = Request::all();
|
||||
$ret = "";
|
||||
if(Request::ajax()) {
|
||||
if($data['action'] === "modal-email-template") {
|
||||
if($data['id'] === 'new'){
|
||||
$value = new EmailTemplate();
|
||||
$value->id = 0;
|
||||
$value->active = 1;
|
||||
}else{
|
||||
$value = EmailTemplate::find($data['id']);
|
||||
|
||||
}
|
||||
$directories = EmailTemplateDir::where('active', '=', true)->get();
|
||||
$ret = view("settings.emails.modal", compact('value', 'directories'))->render();
|
||||
}
|
||||
}
|
||||
return response()->json(['response' => $data, 'html'=>$ret]);
|
||||
}
|
||||
|
||||
public function update(){
|
||||
|
||||
$data = Request::all();
|
||||
$data['active'] = isset($data['active']) ? true : false;
|
||||
$data['step'] = isset($data['step']) ? $data['step'] : false;
|
||||
|
||||
if($data['action'] === 'email_template'){
|
||||
if($data['id'] === "new" || $data['id'] == 0){
|
||||
$model = EmailTemplate::create($data);
|
||||
}else{
|
||||
$model = EmailTemplate::find($data['id']);
|
||||
$model->fill($data);
|
||||
$model->save();
|
||||
}
|
||||
}
|
||||
if($data['action'] === 'email_template_dir') {
|
||||
if($data['id'] === "new"){
|
||||
EmailTemplateDir::create($data);
|
||||
}else{
|
||||
$model = EmailTemplateDir::find($data['id']);
|
||||
$model->fill($data);
|
||||
$model->save();
|
||||
}
|
||||
}
|
||||
|
||||
if($data['action'] === 'customer_mail_dirs') {
|
||||
$data['object'] = [
|
||||
'icon' => $data['icon'],
|
||||
'model' => $data['model'],
|
||||
'emails' => isset($data['emails']) ? Util::_explodeLines($data['emails']) : null,
|
||||
];
|
||||
|
||||
$pos = $data['pos'];
|
||||
if($pos > 9){
|
||||
\Session()->flash('alert-error', 'max 9 Ordner für E-Mail Ablage');
|
||||
return redirect(route('admin_settings_emails', [$data['step']]));
|
||||
}
|
||||
if($data['id'] === "new"){
|
||||
//check ist pos
|
||||
if(CMSContent::where('identifier', '=', $data['identifier'])->where('pos', '=', $pos)->count()){
|
||||
\Session()->flash('alert-error', 'Die ID '.$pos.' existiert schon');
|
||||
return redirect(route('admin_settings_emails', [$data['step']]));
|
||||
}
|
||||
CMSContent::create($data);
|
||||
//store in cms old Datebase
|
||||
\App\Models\Sym\CmsContent::create($data);
|
||||
}else{
|
||||
$model = CMSContent::find($data['id']);
|
||||
if($model->pos != $pos && CMSContent::where('identifier', '=', $data['identifier'])->where('pos', '=', $pos)->count()){
|
||||
\Session()->flash('alert-error', 'Die ID '.$pos.' existiert schon');
|
||||
return redirect(route('admin_settings_emails', [$data['step']]));
|
||||
}
|
||||
$model->fill($data);
|
||||
$model->save();
|
||||
|
||||
$m = \App\Models\Sym\CmsContent::find($data['id']);
|
||||
$m->fill($data);
|
||||
$m->save();
|
||||
}
|
||||
}
|
||||
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('admin_settings_emails', [$data['step']]));
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
|
||||
$model = EmailTemplate::findOrFail($id);
|
||||
$model->delete();
|
||||
\Session()->flash('alert-success', 'Eintrag gelöscht');
|
||||
return redirect()->back();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -4,9 +4,14 @@ namespace App\Http\Controllers\Settings;
|
|||
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Models\GeneralFile;
|
||||
use App\Models\TravelCountry;
|
||||
use App\Models\TravelCountryService;
|
||||
use App\Models\TravelNationality;
|
||||
use App\Repositories\CustomerFileRepository;
|
||||
use App\Repositories\GeneralFileRepository;
|
||||
use App\Services\Util;
|
||||
use IqContent\LaravelFilemanager\Lfm;
|
||||
use Request;
|
||||
|
||||
class TravelCountryController extends Controller
|
||||
|
|
@ -48,27 +53,45 @@ class TravelCountryController extends Controller
|
|||
'id' => $id,
|
||||
'step' => $step,
|
||||
'travel_nationalities' => TravelNationality::where('active', true)->get(),
|
||||
'lfm_helper' => app(Lfm::class),
|
||||
|
||||
];
|
||||
return view('settings.travel_country.detail', $data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function update($id)
|
||||
{
|
||||
|
||||
$data = Request::all();
|
||||
|
||||
if(isset($data['update-action'])){
|
||||
if($data['update-action'] === 'save-travel-county-service'){
|
||||
$data['active'] = true;//isset($data['active']) ? true : false;
|
||||
$travel_country = TravelCountry::findOrFail($id);
|
||||
$data['travel_country_id'] = $travel_country->id;
|
||||
$data['crm_travel_country_id'] = $travel_country->crm_id;
|
||||
if($data['travel_county_service_id'] === 'new'){
|
||||
$model = TravelCountryService::create($data);
|
||||
}else{
|
||||
$model = TravelCountryService::find($data['travel_county_service_id']);
|
||||
$model->fill($data);
|
||||
$model->save();
|
||||
}
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect($data['back']);
|
||||
}
|
||||
}
|
||||
|
||||
$data['contact_emails'] = isset($data['contact_emails']) ? Util::_explodeLines($data['contact_emails']) : null;
|
||||
if(!isset($data['contact_lands'])){
|
||||
$data['contact_lands'] = null;
|
||||
}
|
||||
$data['action'] = isset($data['action']) ? $data['action'] : false;
|
||||
/*
|
||||
* $data['is_customer_country'] = isset($data['is_customer_country']) ? true : false;
|
||||
$data['active_frontend'] = isset($data['active_frontend']) ? true : false;
|
||||
$data['active_backend'] = isset($data['active_backend']) ? true : false;
|
||||
*/
|
||||
if($id === "new"){
|
||||
$data['crm_id'] = 0;
|
||||
$model = TravelCountry::create($data);
|
||||
}else{
|
||||
$model = TravelCountry::find($id);
|
||||
|
|
@ -82,41 +105,64 @@ class TravelCountryController extends Controller
|
|||
$model->setNationalityRequirement($travel_nationality_id, $text);
|
||||
}
|
||||
}
|
||||
|
||||
//TODO for this time
|
||||
if ($data['action'] === 'contact') {
|
||||
//we need an update in the old CRM v1 system DB
|
||||
$tc = \App\Models\Sym\TravelCountry::findOrFail($model->crm_id);
|
||||
if(!$tc){
|
||||
$tc = \App\Models\Sym\TravelCountry::create($data);
|
||||
$model->crm_id = $tc->id;
|
||||
$model->save();
|
||||
}else{
|
||||
$tc->fill($data);
|
||||
$tc->save();
|
||||
}
|
||||
|
||||
$tc = \App\Models\Sym\TravelCountry::find($model->crm_id);
|
||||
if(!$tc){
|
||||
$tc = \App\Models\Sym\TravelCountry::create($data);
|
||||
$model->crm_id = $tc->id;
|
||||
$model->save();
|
||||
}else {
|
||||
$tc->fill($data);
|
||||
$tc->save();
|
||||
}
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('admin_settings_travel_country_detail', [$model->id]));
|
||||
return redirect(route('admin_settings_travel_country_detail', [$model->id, $data['action']]));
|
||||
}
|
||||
|
||||
|
||||
public function delete($id){
|
||||
$model = TravelCountry::findOrFail($id);
|
||||
if( $model->travel_nationality_requirements){
|
||||
foreach($model->travel_nationality_requirements as $travel_nationality_requirement){
|
||||
$travel_nationality_requirement->delete();
|
||||
public function delete($id, $del="travel_country"){
|
||||
|
||||
if($del === 'travel_country'){
|
||||
$model = TravelCountry::findOrFail($id);
|
||||
if($model->travel_nationality_requirements){
|
||||
foreach($model->travel_nationality_requirements as $travel_nationality_requirement){
|
||||
$travel_nationality_requirement->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
$tc = \App\Models\Sym\TravelCountry::find($model->crm_id);
|
||||
if($tc){
|
||||
$tc->delete();
|
||||
$tc = \App\Models\Sym\TravelCountry::find($model->crm_id);
|
||||
if($tc){
|
||||
$tc->delete();
|
||||
}
|
||||
$model->delete();
|
||||
\Session()->flash('alert-success', 'Eintrag gelöscht');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
if($del === 'general_file'){
|
||||
$general_file = GeneralFile::findOrFail($id);
|
||||
$travel_country = $general_file->travel_country;
|
||||
$fileRepo = new GeneralFileRepository($general_file);
|
||||
$fileRepo->_set('disk', 'general');
|
||||
$fileRepo->delete();
|
||||
$general_file->delete();
|
||||
\Session()->flash('alert-success', 'Datei gelöscht');
|
||||
return redirect(route('admin_settings_travel_country_detail', [$travel_country->id, 'data']));
|
||||
|
||||
}
|
||||
if($del === 'country_service'){
|
||||
$travel_country_service = TravelCountryService::findOrFail($id);
|
||||
$travel_country = $travel_country_service->travel_country;
|
||||
//check as entry
|
||||
if($travel_country_service->booking_country_services->count() > 0){
|
||||
\Session()->flash('alert-error', 'Die Leistung kann nicht gelöscht werden, diese hat Einträge bei den Buchungen');
|
||||
return redirect(route('admin_settings_travel_country_detail', [$travel_country->id, 'services']));
|
||||
}
|
||||
$travel_country_service->delete();
|
||||
\Session()->flash('alert-success', 'Eintrag gelöscht');
|
||||
return redirect(route('admin_settings_travel_country_detail', [$travel_country->id, 'services']));
|
||||
|
||||
}
|
||||
|
||||
$model->delete();
|
||||
\Session()->flash('alert-success', 'Eintrag gelöscht');
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,12 @@ use App\Mail\MailSendFeWoInvoice;
|
|||
use App\Mail\MailSendFeWoService;
|
||||
use App\Mail\MailSendFeWoInfo;
|
||||
use App\Models\CMSContent;
|
||||
use App\Models\FewoLodging;
|
||||
use App\Models\FewoReservation;
|
||||
use App\Models\TravelBookingFewoChannel;
|
||||
use App\Models\TravelUserBookingFewo;
|
||||
use App\Models\TravelUserBookingFile;
|
||||
use App\Repositories\BookingFewoFileRepository;
|
||||
use App\Repositories\TravelUserBookingFewoRepository;
|
||||
use App\Services\Util;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
|
@ -23,12 +27,16 @@ class TravelUserBookingFewoController extends Controller
|
|||
$this->middleware('admin');
|
||||
$this->userBookingFewoRepo = $userBookingFewoRepo;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function index($step = false)
|
||||
{
|
||||
$data = [
|
||||
'step' => $step
|
||||
'step' => $step,
|
||||
'filter_fewo_options' => FewoLodging::get()->pluck('name', 'id'),
|
||||
'filter_channel_options' => TravelBookingFewoChannel::get()->pluck('name', 'id'),
|
||||
];
|
||||
return view('travel.user.booking.index', $data);
|
||||
|
||||
|
|
@ -41,13 +49,13 @@ class TravelUserBookingFewoController extends Controller
|
|||
|
||||
$replace_info_text = [];
|
||||
|
||||
if($id == "new") {
|
||||
if($id === "new") {
|
||||
$travel_user_booking_fewo = new TravelUserBookingFewo();
|
||||
$id = 'new';
|
||||
}else{
|
||||
$travel_user_booking_fewo = TravelUserBookingFewo::findOrFail($id);
|
||||
$max_adults = isset($travel_user_booking_fewo->fewo_lodging->maximum_adults) ? $travel_user_booking_fewo->fewo_lodging->maximum_adults : 10;
|
||||
$max_children = isset($travel_user_booking_fewo->fewo_lodging->maximum_childs) ? $travel_user_booking_fewo->fewo_lodging->maximum_childs : 10;;
|
||||
$max_adults = $travel_user_booking_fewo->fewo_lodging->maximum_adults ? $travel_user_booking_fewo->fewo_lodging->maximum_adults : 10;
|
||||
$max_children = $travel_user_booking_fewo->fewo_lodging->maximum_childs ? $travel_user_booking_fewo->fewo_lodging->maximum_childs : 10;;
|
||||
$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(", ");
|
||||
|
|
@ -171,58 +179,87 @@ class TravelUserBookingFewoController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
$model = TravelUserBookingFewo::findOrFail($id);
|
||||
$FewoReservations = FewoReservation::where('lodging_id', $model->fewo_lodging_id)->where('from_date', $model->getFromDateRaw())->where('to_date', $model->getToDateRaw())->get();
|
||||
foreach ($FewoReservations as $FewoReservation){
|
||||
$FewoReservation->delete();
|
||||
public function delete($id, $del="travel_user_booking_fewo"){
|
||||
|
||||
if($del === 'travel_user_booking_fewo') {
|
||||
$model = TravelUserBookingFewo::findOrFail($id);
|
||||
$FewoReservations = FewoReservation::where('lodging_id', $model->fewo_lodging_id)->where('from_date', $model->getFromDateRaw())->where('to_date', $model->getToDateRaw())->get();
|
||||
foreach ($FewoReservations as $FewoReservation) {
|
||||
$FewoReservation->delete();
|
||||
}
|
||||
$model->delete();
|
||||
\Session()->flash('alert-success', __('Buchung gelöscht sowie die Reservierung im Sterntrous Kalender'));
|
||||
}
|
||||
if($del === 'booking_fewo_files'){
|
||||
$booking_fewo_file = TravelUserBookingFile::findOrFail($id);
|
||||
$travel_user_booking_fewo = $booking_fewo_file->travel_user_booking_fewo;
|
||||
$fileRepo = new BookingFewoFileRepository($booking_fewo_file);
|
||||
$fileRepo->_set('disk', 'booking_fewo');
|
||||
$fileRepo->delete();
|
||||
$booking_fewo_file->delete();
|
||||
\Session()->flash('alert-success', 'Datei gelöscht');
|
||||
return redirect(route('travel_user_booking_fewo_detail', [$travel_user_booking_fewo->id]));
|
||||
}
|
||||
$model->delete();
|
||||
\Session()->flash('alert-success', __('Buchung gelöscht sowie die Reservierung im Sterntrous Kalender'));
|
||||
return redirect(route('travel_user_booking_fewos'));
|
||||
}
|
||||
|
||||
private function prozessTravelUserBookingFewosSearch(){
|
||||
|
||||
$query = TravelUserBookingFewo::with('travel_booking_fewo_channel')->with('fewo_lodging')
|
||||
->select('travel_user_booking_fewos.*')
|
||||
->where('deleted_at', '=', null);
|
||||
|
||||
if(Request::get('option_fewo_id') != ""){
|
||||
$query->where('fewo_lodging_id', '=', Request::get('option_fewo_id'));
|
||||
}
|
||||
if(Request::get('option_channel_id') != ""){
|
||||
$query->where('travel_booking_fewo_channel_id', '=', Request::get('option_channel_id'));
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function getTravelUserBookingFewos()
|
||||
{
|
||||
//confirmation_code_remider is delete 2
|
||||
$query = TravelUserBookingFewo::where('deleted_at', '=', null);
|
||||
|
||||
$query = $this->prozessTravelUserBookingFewosSearch();
|
||||
|
||||
return \DataTables::eloquent($query)
|
||||
->addColumn('action_edit', function (TravelUserBookingFewo $travel_user_booking_fewo) {
|
||||
return '<a data-order="'.$travel_user_booking_fewo->id.'" href="' . route('travel_user_booking_fewo_detail', [$travel_user_booking_fewo->id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
|
||||
})
|
||||
->addColumn('fewo_lodging', function (TravelUserBookingFewo $travel_user_booking_fewo) {
|
||||
//return '<a href="' . route('travel_user_booking_fewo_detail', [$travel_user_booking_fewo->fewo_lodging_id]) . '">'.$travel_user_booking_fewo->fewo_lodging->name.'</a>';
|
||||
return $travel_user_booking_fewo->fewo_lodging->name;
|
||||
})
|
||||
->addColumn('travel_user', function (TravelUserBookingFewo $travel_user_booking_fewo) {
|
||||
return '<a href="' . route('travel_user_detail', [$travel_user_booking_fewo->travel_user_id]) . '">'.$travel_user_booking_fewo->travel_user->first_name.' '.$travel_user_booking_fewo->travel_user->last_name.'</a>';
|
||||
})
|
||||
->addColumn('is_calendar', function (TravelUserBookingFewo $travel_user_booking_fewo) {
|
||||
$back = "";
|
||||
$back = "<div class='no-break'>";
|
||||
$back .= get_active_badge($travel_user_booking_fewo->is_calendar_fewo_direct, "FEWO Direkt")." ";
|
||||
$back .= get_active_badge($travel_user_booking_fewo->is_calendar_hrs, "HRS")." ";
|
||||
$back .= get_active_badge($travel_user_booking_fewo->is_calendar_stern_tours, "STERN TOURS");
|
||||
$back .= "</div>";
|
||||
return $back;
|
||||
})
|
||||
->addColumn('is_mail', function (TravelUserBookingFewo $travel_user_booking_fewo) {
|
||||
$back = "";
|
||||
$back = "<div class='no-break'>";
|
||||
$back .= get_active_badge($travel_user_booking_fewo->isSendUserMail(), "Mietbestätigung")." ";
|
||||
$back .= get_active_badge($travel_user_booking_fewo->isSendInfoMail(), "Anrreiseinfo")." ";
|
||||
$back .= get_active_badge($travel_user_booking_fewo->isSendServiceMail(), "Dienstleister Mail");
|
||||
$back .= "</div>";
|
||||
return $back;
|
||||
})
|
||||
->addColumn('status_name', function (TravelUserBookingFewo $travel_user_booking_fewo) {
|
||||
return $travel_user_booking_fewo->getStatuesName();
|
||||
})
|
||||
->addColumn('action_delete', function (TravelUserBookingFewo $travel_user_booking_fewo) {
|
||||
return '<a href="' . route('travel_user_booking_fewo_delete', [$travel_user_booking_fewo->id]) . '" class="btn icon-btn btn-sm btn-danger" onclick="return confirm(\''.__('Really delete entry?').'\');"><span class="fa fa-trash"></span></a>';
|
||||
})
|
||||
->rawColumns(['action_edit', 'fewo_lodging', 'travel_user', 'is_calendar', 'is_mail', 'action_delete'])
|
||||
->filterColumn('fewo_lodging.name', function ($query, $keyword) {
|
||||
if ($keyword != "") {
|
||||
$query->whereHas('travel_user', function ($q) use ($keyword) {
|
||||
$q->where("first_name", 'LIKE', '%' . $keyword . '%')
|
||||
->orWhere('last_name', 'LIKE', '%' . $keyword . '%');
|
||||
});
|
||||
}
|
||||
})
|
||||
->rawColumns(['action_edit', 'travel_user', 'is_calendar', 'is_mail', 'action_delete'])
|
||||
->make(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue