Mail Weiterleitung / verlauf / Notizen Buchnungen

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

2
.env
View file

@ -44,7 +44,7 @@ MAIL_FEWO_EMPLOYEE=kevin@adametz.media
#MAIL_FEWO_EMPLOYEE=katrin.nikolai@stern-tours.de,gerda.fritsch@stern-tours.de
#MAIL_BBC=kontakt@stern-tours.de,thomas.stern@stern-tours.de
MAIL_FROM_ADDRESS=info@mein.sterntours.de
MAIL_FROM_NAME="Mein Reisebüro STERN TOURS"
MAIL_FROM_NAME="Reisebüro STERN TOURS"
MAIL_DRIVER=smtp
MAIL_HOST=mail.your-server.de
MAIL_PORT=587

View file

@ -0,0 +1,71 @@
<?php
namespace App\Http\Controllers\API;
use Request;
use Validator;
use App\Models\Lead;
use App\Models\Customer;
use App\Http\Controllers\Controller;
class LeadController extends Controller
{
public $successStatus = 200;
public $errorStatus = 500;
public $data = "";
public $room_str = "";
public $room_name = "";
public $className = "";
public $option = "";
public function action($action)
{
if ($action == "create_lead") {
$data = Request::all();
if(!isset($data['lead']) && !is_array($data['lead'])) {
return response()->json(['error' => 'lead not exist, but need'], $this->errorStatus);
}
if(!isset($data['lead']['customerForm'])){
return response()->json(['error' => 'lead customerForm not exist, but need'], $this->errorStatus);
}
//customer
/* $rules = array(
'name' => 'required',
'email' => 'requird'
);
$validator = Validator::make($data['lead']['customerForm'], $rules);
if ($validator->fails()) {
return response()->json($validator->messages(), $this->errorStatus);
}
//lead
$rules = array(
'sf_guard_user_id' => 'required',
'status_id' => 'requird',
'request_date' => 'requird'
);
$validator = Validator::make($data['lead'], $rules);
if ($validator->fails()) {
return response()->json($validator->messages(), $this->errorStatus);
}*/
$customer = Customer::create($data['lead']['customerForm']);
unset($data['lead']['customerForm']);
$data['lead']['customer_id'] = $customer->id;
$lead = Lead::create($data['lead']);
$ret= [
'url_v1' => make_old_url('/index.php/leads/'.$lead->id.'/edit'),
'url_v3' => route('lead_detail', $lead->id),
'lead_id' => $lead->id
];
return response()->json(['success' => $ret], $this->successStatus);
}
}
}

View file

@ -58,6 +58,12 @@ class BookingController extends Controller
$data = Request::all();
if($data['action'] === 'save_notice'){
$booking = $this->bookingRepo->updateNotice($id, $data);
\Session()->flash('alert-save', '1');
return redirect(route('booking_detail', [$booking->id])."#collapseBookingNotice");
}
if($data['action'] === 'update_booking'){
$booking = $this->bookingRepo->updateBooking($id, $data);
\Session()->flash('alert-save', '1');
@ -268,6 +274,12 @@ class BookingController extends Controller
\Session()->flash('alert-success', 'Datei gelöscht');
return redirect(route('booking_detail', [$booking->id]));
}
if($del === 'passolution_file'){
$booking = Booking::findOrFail($id);
$booking->resyncPassolutionPDF();
\Session()->flash('alert-success', 'Passolution erneuert');
return redirect(route('booking_detail', [$booking->id]));
}
return redirect(route('requests'));
}

View file

@ -86,6 +86,7 @@ class CustomerFewoMailController extends Controller
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'] = [];

View file

@ -7,6 +7,7 @@ use App\Models\CustomerFewoMail;
use App\Models\CustomerFile;
use App\Models\CustomerMail;
use App\Models\EmailTemplate;
use App\Repositories\CustomerFewoMailRepository;
use App\Repositories\CustomerMailRepository;
use App\Repositories\CustomerFileRepository;
use App\Services\Util;
@ -72,6 +73,22 @@ class CustomerMailController extends Controller
$customer_mail->subdir = $data['subdir'];
$customer_mail->save();
}
if($action === 'forward_fewo-email'){
$customer_mail = CustomerFewoMail::findOrFail($id);
$customerMailFewoRepo = new CustomerFewoMailRepository($customer_mail);
$customerMailFewoRepo->forwardMail($customer_mail, $data);
\Session()->flash('alert-success', __('E-Mail weitergeleitet'));
}
if($action === 'forward_email'){
$customer_mail = CustomerMail::findOrFail($id);
$this->customerMailRepo->forwardMail($customer_mail, $data);
\Session()->flash('alert-success', __('E-Mail weitergeleitet'));
}
return back();
}
@ -164,10 +181,17 @@ class CustomerMailController extends Controller
->addColumn('send', function (CustomerMail $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>';
})
->addColumn('date', function (CustomerMail $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>';
})
->orderColumn('id', 'id $1')
->orderColumn('booking_id', 'booking_id $1')
->orderColumn('customer_id', 'customer_id $1')
->orderColumn('send', 'send $1')
->orderColumn('date', 'sent_at $1')
->filterColumn('id', function($query, $keyword) {
if($keyword != ""){
@ -184,7 +208,7 @@ class CustomerMailController extends Controller
$query->where('booking_id', 'LIKE', '%'.$keyword.'%');
}
})
->rawColumns(['action_edit', 'send', 'customer_id', 'booking_id', 'id'])
->rawColumns(['action_edit', 'send', 'date', 'customer_id', 'booking_id', 'id'])
->make(true);
}
@ -331,7 +355,8 @@ class CustomerMailController extends Controller
})
->addColumn('subject', function (CustomerMail $customer_mail) {
$icon = $customer_mail->reply_id ? 'ion-ios-redo' : 'ion-ios-mail';
$icon = $customer_mail->reply_id ? '<i class="ion ion-ios-redo ui-w-20 text-center" style="opacity: 0.7"></i>' : '<i class="ion ion-ios-mail ui-w-20 text-center" style="opacity: 0.7"></i>';
$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>' : '';
@ -339,11 +364,16 @@ class CustomerMailController extends Controller
$id = $customer_mail->draft ? $customer_mail->id : 'new';
$url = $customer_mail->draft ? route('customer_mail_send_mail') : '';
$deep = $customer_mail->customer_mail_deep();
for ($i=1; $i < $deep; $i++) {
$icon .= '<i class="ion ion-ios-redo ui-w-20 text-center" style="opacity: 0.7"></i>';
}
return '<a href="javascript:void(0)" class="badge '.$badge.'" data-toggle="modal"
data-target="#modals-load-content" data-id="'.$id.'" data-model="customerMail"
data-action="'.$action.'" data-url="'.$url.'" data-redirect="back"
data-customer_mail_id="'.$customer_mail->id.'" data-route="'.route('booking_modal_load').'">
'.$to_icon.'<i class="ion '.$icon.' ui-w-30 text-center" style="opacity: 0.7"></i>'.$customer_mail->subject.'
'.$to_icon.''.$icon.' '.$customer_mail->subject.'
'.($customer_mail->customer_files->count() ? '&nbsp; <i class="ion ion-md-attach"> <span class="badge badge-primary indicator">'.$customer_mail->customer_files->count().'</span></i>' : '');
})

View file

@ -2,6 +2,7 @@
namespace App\Http\Controllers;
use App\Models\BookingNotice;
use App\Models\SfGuardUser;
use App\User;
use Auth;
@ -40,8 +41,11 @@ class HomeController extends Controller
if(!Auth::check()){
return redirect('login');
}
$last_booking_notices = BookingNotice::orderBy('created_at', 'DESC')->limit(10)->get();
$data = [
'user' => Auth::user(),
'last_booking_notices' => $last_booking_notices,
];
return view('home', $data);
}

View file

@ -233,7 +233,6 @@ class RequestController extends Controller
if(isset($data['action']) && $data['action'] === "get_popover_booking_services") {
$booking = Booking::findOrFail($data['booking_id']);
$ret = "";
$count = false;
foreach($booking->travel_country->getContactLandsModels() as $TravelCountry){
if($TravelCountry->stern_travel_country){
@ -291,6 +290,20 @@ class RequestController extends Controller
}
return $ret;
}
if(isset($data['action']) && $data['action'] === "get_popover_booking_notice"){
$booking = Booking::findOrFail($data['booking_id']);
$ret = "";
if($booking->booking_notices->count()){
$booking_notice = $booking->booking_notices->first();
return $booking_notice->getSmallerMessage(500);
}
if($ret === ""){
return 'keine Notiz';
}
return $ret;
}
$query = $this->getSearchRequests();
$ret = $query->get()->pluck('travelagenda_id', 'id')->unique()->toArray();
return TravelAgenda::whereIn('id', $ret)->get()->pluck('name', 'id');
@ -363,9 +376,15 @@ class RequestController extends Controller
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_services', function (Booking $booking) {
return $booking->hasBookingServicesUnchecked() ? '<span data-order="1" class="badge badge-pill badge-success" data-booking_id="'.$booking->id.'" data-placement="top" data-toggle="popover" title="ServiceLeistungen"><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="ServiceLeistungen"><i class="fa fa-times"></i></span>';
return $booking->hasBookingServicesUnchecked() ? '<span data-order="1" class="badge badge-pill badge-success" data-booking_id="'.$booking->id.'" data-action="get_popover_booking_services" data-placement="top" data-toggle="popover" title="ServiceLeistungen"><i class="fa fa-check"></i></span>' :
'<span data-order="0" class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
})
->addColumn('booking_notice', function (Booking $booking) {
return $booking->booking_notices->count() ? '<span data-order="1" class="badge badge-pill badge-success" data-booking_id="'.$booking->id.'" data-action="get_popover_booking_notice" data-placement="top" data-toggle="popover" title="letzte Notiz"><i class="fa fa-check"></i></span>' :
'<span data-order="0" class="badge badge-pill badge-danger"><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>';
@ -467,7 +486,7 @@ class RequestController extends Controller
->orderColumn('xx_tkt', 'xx_tkt_date $1')
->orderColumn('comfort', 'comfort $1')
//->orderColumn('travel_documents', 'travel_documents $1')
->rawColumns(['action_lead_edit', 'comfort', '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_services', 'paying_out', 'paying_out_status', 'airline_id', 'refund', 'hold', 'xx_tkt'])
->rawColumns(['action_lead_edit', 'comfort', '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_services', 'booking_notice', 'paying_out', 'paying_out_status', 'airline_id', 'refund', 'hold', 'xx_tkt'])
->make(true);
}
}

View file

@ -524,6 +524,11 @@ class Booking extends Model
return $this->belongsTo(TravelNationality::class, 'nationality_id');
}
public function booking_notices()
{
return $this->hasMany(BookingNotice::class, 'booking_id')->orderBy('created_at', 'DESC');
}
public function hasBookingServicesUnchecked(){
$country_services = true;
$provider_services = true;
@ -547,14 +552,18 @@ class Booking extends Model
return false;
}
public function getPassolutionPDF($create = false){
public function getPassolutionPDF($create = false, $resync = false){
$nats = [];
if(count($this->passolutionPDFs)){
return $this->passolutionPDFs;
return $this->passolutionPDFs;
}
if(!$this->travel_country){
return $this->passolutionPDFs;
}
$destco = $this->travel_country->destco;
if($this->travel_nationality){
$nats[$this->travel_nationality->nat] = $this->travel_nationality->nat;
@ -566,6 +575,11 @@ class Booking extends Model
}
}
}
if(empty($nats)){
$nats['de'] = 'de';
}
foreach ($nats as $nat){
$data = [
'nat' => $nat,
@ -573,11 +587,15 @@ class Booking extends Model
];
$passolution = new Passolution($data);
$this->passolutionPDFs[] = $passolution->findOrCreatePDF($create);
$this->passolutionPDFs[] = $passolution->findOrCreatePDF($create, $resync);
}
return $this->passolutionPDFs;
}
public function resyncPassolutionPDF(){
return $this->getPassolutionPDF(true, true);
}
public function calculate_price_total()
{
$travel_draft_item = false;

View file

@ -0,0 +1,85 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use App\User;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class BookingNotice
*
* @property int $id
* @property int $booking_id
* @property int $from_user_id
* @property int $to_user_id
* @property string $message
* @property bool $show
* @property bool $important
* @property Carbon $created_at
* @property Carbon $updated_at
*
* @property Booking $booking
* @property User $user
*
* @package App\Models
*/
class BookingNotice extends Model
{
protected $table = 'booking_notices';
protected $casts = [
'booking_id' => 'int',
'from_user_id' => 'int',
'to_user_id' => 'int',
'show' => 'bool',
'important' => 'bool'
];
protected $fillable = [
'booking_id',
'from_user_id',
'to_user_id',
'message',
'show',
'important'
];
public function booking()
{
return $this->belongsTo(Booking::class);
}
public function to_user()
{
return $this->belongsTo(User::class, 'to_user_id');
}
public function from_user()
{
return $this->belongsTo(User::class, 'from_user_id');
}
public function getName(){
if($this->from_user){
if($this->from_user->sf_guard_user){
return $this->from_user->sf_guard_user->first_name." ".$this->from_user->sf_guard_user->last_name;
}else{
$this->from_user->name;
}
}
}
public function getSmallerMessage($max = 500){
$ret = substr($this->message, 0, $max);
if(strlen($this->message) > 500){
$ret .= " ...";
}
return $ret;
}
}

View file

@ -102,6 +102,7 @@ class CustomerFewoMail extends Model
'send' => 'bool',
'fail' => 'bool',
'recipient' => 'array',
'forward' => 'array',
'cc' => 'array',
'bcc' => 'array'
];
@ -131,6 +132,7 @@ class CustomerFewoMail extends Model
'send',
'fail',
'error',
'forward',
'sent_at',
'scheduled_at',
'delivered_at'
@ -204,4 +206,15 @@ class CustomerFewoMail extends Model
if(!$this->attributes['created_at']){ return ""; }
return Carbon::parse($this->attributes['created_at'])->format(\Util::formatDateTimeDB());
}
public function setForwardMessage($forward = [])
{
if($forward && is_array($forward)){
if(isset($this->forward) && $this->forward){
$this->forward = array_merge($this->forward , $forward);
}else{
$this->forward = $forward;
}
$this->save();
}
}
}

View file

@ -105,6 +105,7 @@ class CustomerMail extends Model
'send' => 'bool',
'fail' => 'bool',
'recipient' => 'array',
'forward' => 'array',
'cc' => 'array',
'bcc' => 'array'
];
@ -135,6 +136,7 @@ class CustomerMail extends Model
'send',
'fail',
'error',
'forward',
'sent_at',
'scheduled_at',
'delivered_at'
@ -188,4 +190,23 @@ class CustomerMail extends Model
if(!$this->attributes['created_at']){ return ""; }
return Carbon::parse($this->attributes['created_at'])->format(\Util::formatDateTimeDB());
}
public function customer_mail_deep($deep = 0){
if($this->customer_mail){
$deep = $this->customer_mail->customer_mail_deep(++$deep);
}
return $deep;
}
public function setForwardMessage($forward = [])
{
if($forward && is_array($forward)){
if(isset($this->forward) && $this->forward){
$this->forward = array_merge($this->forward , $forward);
}else{
$this->forward = $forward;
}
$this->save();
}
}
}

View file

@ -2,6 +2,7 @@
namespace App\Models;
use App\User;
use Illuminate\Database\Eloquent\Model;
@ -59,4 +60,9 @@ class SfGuardUser extends Model
protected $table = 'sf_guard_user';
public function user()
{
return $this->belongsTo(User::class, 'user_id');
}
}

View file

@ -4,6 +4,8 @@ namespace App\Repositories;
use App\Models\Booking;
use App\Models\BookingNotice;
use Auth;
use App\Models\BookingCompanyService;
use App\Models\BookingCountryService;
use App\Models\BookingProviderService;
@ -21,6 +23,20 @@ class BookingRepository extends BaseRepository {
return $this->model;
}
public function updateNotice($id, $data){
$this->model = Booking::findOrFail($id);
BookingNotice::create([
'booking_id' => $this->model->id,
'from_user_id' => Auth::user()->id,
'to_user_id' => isset($this->model->sf_guard_user->user_id) ? $this->model->sf_guard_user->user_id : null,
'message' => isset($data['booking_notice']) ? $data['booking_notice'] : "",
]
);
return $this->model;
}
public function updateBooking($id, $data){
$this->model = Booking::findOrFail($id);

View file

@ -67,6 +67,37 @@ class CustomerFewoMailRepository extends BaseRepository {
}
}
}
public function forwardMail($customer_mail, $data){
//send or draft
//$data['action']
if(isset($data['customer_mail_forward_email']) && !empty($data['customer_mail_forward_email'])) {
$to_mails = [];
if(strpos($data['customer_mail_forward_email'], ',')){
$to_mails = array_map('trim', explode(',', $data['customer_mail_forward_email']));
}else{
$to_mails[] = $data['customer_mail_forward_email'];
}
$customer_files = $customer_mail->customer_files;
$full_message = $this->prepareMessageFull($customer_mail);
try {
//
Mail::to($to_mails)
->bcc($customer_mail->bcc ?: [])
->send(new MailSendInfo($customer_mail->subject, $full_message, $customer_files));
}
catch(\Exception $e){
// Never reached
$forward = array();
$forward[now()->format("d.m.Y H:i:s")] = ['fail'=> true, 'to'=> $data['customer_mail_forward_email'], 'error'=>$e->getMessage()];
$customer_mail->setForwardMessage($forward);
return false;
}
$forward = array();
$forward[now()->format("d.m.Y H:i:s")] = ['sent'=> true, 'to'=> $data['customer_mail_forward_email']];
$customer_mail->setForwardMessage($forward);
return true;
}
}
public function replyStore($data){
if(isset($data['travel_user_booking_fewo_id']) && $booking_fewo = TravelUserBookingFewo::find($data['travel_user_booking_fewo_id'])) {
@ -149,12 +180,14 @@ class CustomerFewoMailRepository extends BaseRepository {
$to_mails = array_merge($to_mails, $customer_mail->recipient);
}
$customer_files = $customer_mail->customer_files;
$full_message = $this->prepareMessageFull($customer_mail);
try {
//
Mail::to($to_mails)
->cc($customer_mail->cc ?: [])
->bcc($customer_mail->bcc ?: [])
->send(new MailSendInfo($customer_mail->subject, $customer_mail->message, $customer_files));
->send(new MailSendInfo($customer_mail->subject, $full_message, $customer_files));
}
catch(\Exception $e){
// Never reached
@ -168,6 +201,22 @@ class CustomerFewoMailRepository extends BaseRepository {
$customer_mail->save();
return true;
}
private function prepareMessageFull($customer_mail, $deep = 0){
$ret = "";
if($deep === 0){
$ret .= $customer_mail->message;
}else{
$ret .= "--------------------------------\n";
$ret .= $customer_mail->is_answer ? "Antwort von: " : "Gesendet an: ";
$ret .= "&lt;".$customer_mail->email."&gt; ".$customer_mail->sent_at."\n";
$ret .= "<strong>".$customer_mail->subject."</strong>\n";
$ret .= $customer_mail->message;
}
if($customer_mail->customer_mail){
$ret .= $this->prepareMessageFull($customer_mail->customer_mail, $deep+1);
}
return $ret;
}
private function prepareContent($booking_fewo, $content){
$content = Placeholder::replaceBookingFewo($booking_fewo, $content);
@ -309,7 +358,7 @@ class CustomerFewoMailRepository extends BaseRepository {
$value->draft = false;
$value->booking = $booking_fewo;
$value->message = "";
$value->subject = "";
$value->subject = " - (".$value->booking->invoice_number.")";
$value->lead_title_id = " - (".$value->booking->invoice_number.")";
$value->s_placeholder = "Betreff des Kunden";
$value->m_placeholder = "Nachricht des Kunden";

View file

@ -59,7 +59,6 @@ class CustomerMailRepository extends BaseRepository {
$file->identifier = 'mail';
$file->save();
}
if(isset($data['action']) && $data['action'] === 'send'){ //not at draft
$this->sendMail($customer_mail);
}
@ -69,6 +68,38 @@ class CustomerMailRepository extends BaseRepository {
}
}
public function forwardMail($customer_mail, $data){
//send or draft
//$data['action']
if(isset($data['customer_mail_forward_email']) && !empty($data['customer_mail_forward_email'])) {
$to_mails = [];
if(strpos($data['customer_mail_forward_email'], ',')){
$to_mails = array_map('trim', explode(',', $data['customer_mail_forward_email']));
}else{
$to_mails[] = $data['customer_mail_forward_email'];
}
$customer_files = $customer_mail->customer_files;
$full_message = $this->prepareMessageFull($customer_mail);
try {
//
Mail::to($to_mails)
->bcc($customer_mail->bcc ?: [])
->send(new MailSendInfo($customer_mail->subject, $full_message, $customer_files));
}
catch(\Exception $e){
// Never reached
$forward = array();
$forward[now()->format("d.m.Y H:i:s")] = ['fail'=> true, 'to'=> $data['customer_mail_forward_email'], 'error'=>$e->getMessage()];
$customer_mail->setForwardMessage($forward);
return false;
}
$forward = array();
$forward[now()->format("d.m.Y H:i:s")] = ['sent'=> true, 'to'=> $data['customer_mail_forward_email']];
$customer_mail->setForwardMessage($forward);
return true;
}
}
public function replyStore($data){
if(isset($data['booking_id']) && $booking = Booking::find($data['booking_id'])) {
//has Attachments
@ -152,12 +183,13 @@ class CustomerMailRepository extends BaseRepository {
$to_mails = array_merge($to_mails, $customer_mail->recipient);
}
$customer_files = $customer_mail->customer_files;
$full_message = $this->prepareMessageFull($customer_mail);
try {
//
Mail::to($to_mails)
->cc($customer_mail->cc ?: [])
->bcc($customer_mail->bcc ?: [])
->send(new MailSendInfo($customer_mail->subject, $customer_mail->message, $customer_files));
->send(new MailSendInfo($customer_mail->subject, $full_message, $customer_files));
}
catch(\Exception $e){
// Never reached
@ -172,6 +204,23 @@ class CustomerMailRepository extends BaseRepository {
return true;
}
private function prepareMessageFull($customer_mail, $deep = 0){
$ret = "";
if($deep === 0){
$ret .= $customer_mail->message;
}else{
$ret .= "--------------------------------\n";
$ret .= $customer_mail->is_answer ? "Antwort von: " : "Gesendet an: ";
$ret .= "&lt;".$customer_mail->email."&gt; ".$customer_mail->sent_at."\n";
$ret .= "<strong>".$customer_mail->subject."</strong>\n";
$ret .= $customer_mail->message;
}
if($customer_mail->customer_mail){
$ret .= $this->prepareMessageFull($customer_mail->customer_mail, $deep+1);
}
return $ret;
}
private function prepareContent($booking, $content){
$content = Placeholder::replaceBooking($booking, $content);
return $content;
@ -217,6 +266,7 @@ class CustomerMailRepository extends BaseRepository {
$value->lead_title_id = "";
$value->filter_email_templates_directories = EmailTemplate::join('email_template_dirs', 'email_template_dir_id', '=', 'email_template_dirs.id')->get()->pluck('name', 'id')->unique()->toArray();
/*Ansicht*/
if ($data['action'] === "show-customer-mail") {
if (isset($data['customer_mail_id']) && $customer_mail = CustomerMail::find($data['customer_mail_id'])) {
@ -315,7 +365,7 @@ class CustomerMailRepository extends BaseRepository {
$value->draft = false;
$value->booking = $booking;
$value->message = "";
$value->subject = "";
$value->subject = " - (".$value->booking->lead_id.")";
$value->lead_title_id = " - (".$value->booking->lead_id.")";
$value->s_placeholder = "Betreff des Kunden";
$value->m_placeholder = "Nachricht des Kunden";
@ -335,6 +385,7 @@ class CustomerMailRepository extends BaseRepository {
$value->customer_mail_subdir = isset($data['customer_mail_subdir']) ? $data['customer_mail_subdir'] : 0;
$value = self::prepareContactMails($value);
return view("customer.mail.modal-new-mail", compact('data', 'value'))->render();
}

View file

@ -170,12 +170,12 @@ class Passolution
$pdf_file->create(['contents' => $this->htmlText], $this->pdf_name, 'save', $this->pdf_path.$this->pdf_dir);
}
public function findOrCreatePDF($create = false){
public function findOrCreatePDF($create = false, $resync = false){
$this->createPDFName();
$this->storagePath();
$bool = Storage::disk('public')->exists( $this->pdf_dir.$this->pdf_name );
if(!$bool && $create){
if(!$bool && $create || $resync){
$this->read();
$this->onlyCreatePDF();
$bool = true;

View file

@ -46,7 +46,7 @@ class Placeholder
$title = $booking->customer->title;
$country = $booking->travel_country_id ? $booking->travel_country->name : "-";
$program = $booking->travelagenda_id ? $booking->travel_agenda->name : "-";
$salutation = $booking->customer->salutation->name;
$salutation = isset($booking->customer->salutation) ? $booking->customer->salutation->name : '';
$start_date = $booking->getStartDateFormat();
$end_date = $booking->getEndDateFormat();
$booking_date = $booking->getBookingDateFormat();

View file

@ -3,12 +3,13 @@
namespace App;
use Carbon\Carbon;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Support\Facades\Mail;
use App\Models\SfGuardUser;
use App\Mail\MailResetPassword;
use Illuminate\Database\Eloquent\SoftDeletes;
use Laravel\Passport\HasApiTokens;
use Illuminate\Support\Facades\Mail;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
/**
@ -113,7 +114,10 @@ class User extends Authenticatable
'permissions' => 'array',
];
public function sf_guard_user()
{
return $this->hasOne(SfGuardUser::class, 'user_id', 'id');
}
public function account()
{

View file

@ -57,7 +57,7 @@ return [
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'stern@sterntours.de'),
'name' => env('MAIL_FROM_NAME', 'Mein Reisebüro STERN TOURS'),
'name' => env('MAIL_FROM_NAME', 'Reisebüro STERN TOURS'),
],
'mail_bbc' => explode(',', env('MAIL_BBC', 'kontakt@stern-tours.de')),
'mail_fewo_employee' => env('MAIL_FEWO_EMPLOYEE', 'kontakt@stern-tours.de'),

View file

@ -13,7 +13,7 @@ class CreateIQContentCategoriesTable extends Migration
*/
public function up()
{
Schema::connection('mysql_stern')->create('i_q_content_categories', function (Blueprint $table) {y
Schema::connection('mysql_stern')->create('i_q_content_categories', function (Blueprint $table) {
$table->bigIncrements('id');

View file

@ -41,6 +41,8 @@ class CreateCustomerMailsTable extends Migration
$table->boolean('send')->default(false);
$table->boolean('fail')->default(false);
$table->text('error')->nullable();
$table->text('forward')->nullable();
$table->timestamp('sent_at')->nullable();
$table->timestamp('scheduled_at')->nullable();

View file

@ -40,6 +40,8 @@ class CreateCustomerFewoMailsTable extends Migration
$table->boolean('send')->default(false);
$table->boolean('fail')->default(false);
$table->text('error')->nullable();
$table->text('forward')->nullable();
$table->timestamp('sent_at')->nullable();
$table->timestamp('scheduled_at')->nullable();

View file

@ -0,0 +1,57 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBookingNoticesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('booking_notices', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('booking_id');
//from
$table->unsignedInteger('from_user_id');
//to
$table->unsignedInteger('to_user_id')->nullable();
$table->text('message')->nullable();
$table->boolean('show')->default(false);
$table->boolean('important')->default(false);
$table->timestamps();
$table->foreign('booking_id')
->references('id')
->on('booking');
$table->foreign('from_user_id')
->references('id')
->on('users')
->onDelete('CASCADE');
$table->foreign('to_user_id')
->references('id')
->on('users')
->onDelete('CASCADE');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('booking_notices');
}
}

View file

@ -0,0 +1,8 @@
{
"folders": [
{
"path": "."
}
],
"settings": {}
}

View file

@ -207,7 +207,7 @@
</tr>
@endif
@endforeach
@if($booking->travel_country)
@foreach($booking->travel_country->getContactLandsModels() as $TravelCountry)
@if($TravelCountry->stern_travel_country)
@foreach($TravelCountry->stern_travel_country->general_files as $general_files)
@ -235,13 +235,13 @@
@endforeach
@endif
@endforeach
@endif
@foreach($booking->getPassolutionPDF() as $PassolutionPDF)
@if($PassolutionPDF)
<tr>
<th scope="row">{{$booking_files_count++}}</th>
<td>
<a target="_blank" href="{{ $PassolutionPDF['url'] }}" class="badge badge-md badge-next">
<a target="_blank" href="{{ $PassolutionPDF['url'] }}?t={{ time() }}" class="badge badge-md badge-next">
<i class="fa fa-file-pdf mr-1"></i> {{$PassolutionPDF['filename']}}
</a>
</td>
@ -251,7 +251,7 @@
</td>
<td>{{\App\Services\Util::_format_date($PassolutionPDF['date'], 'date')}}</td>
<td>
<a href="{{ $PassolutionPDF['url'] }}" class="btn btn-xs btn-default"
<a href="{{ $PassolutionPDF['url'] }}?t={{ time() }}" class="btn btn-xs btn-default"
title="Download" data-placement="left" rel="tooltip" download="">
<i class="fa fa-download"></i>
</a>
@ -297,6 +297,11 @@
@if(Auth::user()->isPermission('sua-st-co'))
<br><div class="float-left small">Landesspezifische Dateien unter: <a href="{{route('admin_settings_travel_country', [])}}">Einstellungen -> Reieseländer</a></div>
@endif
<br><div class="float-left small">Passolution Dateien aktualisieren: <a class="ml-2 btn btn-xs btn-warning" href="{{ route('booking_delete', [$booking->id, 'passolution_file']) }}" onclick="return confirm('{{__('Wirklich löschen?')}}');"><i class="fa fa-sync"></i></a>
</div>
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal"
data-target="#modals-load-content"
data-id="new-file"

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -110,7 +110,7 @@
</div>
</div>
@endif
@if(isset($show_move_dirs))
@if(isset($show_move_dirs) && $show_move_dirs)
<hr class="border-light m-0">
<div class="px-4 pt-4 pb-2">
{!! Form::open(['url' => route('customer_mail_detail', [$customer_mail->id, 'move-mail']), 'class' => 'move-mail-form']) !!}
@ -125,7 +125,6 @@
</div>
<div class="col-sm-6">
<button type="submit" class="btn btn-xs btn-default float-right mt-1"><i class="ion ion-ios-redo"></i>&nbsp; verschieben</button>
<label for="subdir" class="form-label">&nbsp;</label>
{{-- TODO load subdirs by pos id --}}
@if($customer_mail->booking->travel_country)
@ -144,6 +143,24 @@
</div>
</div>
{!! Form::close() !!}
<hr>
{!! Form::open(['url' => route('customer_mail_detail', [$customer_mail->id, 'forward_email']), 'class' => 'forward-mail-form']) !!}
<div class="form-row">
<div class="col-sm-6">
<label for="customer_mail_forward_email" class="form-label">E-Mail weiterleiten:</label>
{{ Form::text('customer_mail_forward_email', $customer_mail->email, array('placeholder'=>'E-Mail', 'id'=>'customer_mail_forward_email', 'class'=>'form-control', 'required')) }}
</div>
<div class="col-sm-6">
<button type="submit" class="btn btn-xs btn-default float-right mt-1" onclick="return confirm('{{__('Wirklich weiterleiten? E-Mail wird erneut gesendet!')}}');"><i class="ion ion-ios-send"></i>&nbsp; weiterleiten</button>
</div
</div>
{!! Form::close() !!}
</div>
@endif
</div>
</div>
@if(isset($customer_mail->customer_mail))
<hr>
@include('customer.mail.modal-show-mail-inner', ['customer_mail' => $customer_mail->customer_mail, 'show_move_dirs' => false])
@endif

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -451,7 +451,9 @@
function callback_email_template_data_table(data) {
if(data.status === 'success'){
$('input#subject').val(data.response.subject + $('input#lead_title_id').val());
if($('input#subject').val() === $('input#lead_title_id').val()){
$('input#subject').val(data.response.subject + $('input#lead_title_id').val());
}
$("input#message-editor-fallback").val(data.html);
$('#message-editor .ql-editor').html(data.html)
$('#collapseModalEmailTemplate').collapse('hide');

View file

@ -105,7 +105,7 @@
</div>
</div>
@endif
@if(isset($show_move_dirs))
@if(isset($show_move_dirs) && $show_move_dirs)
<hr class="border-light m-0">
<div class="px-4 pt-4 pb-2">
{!! Form::open(['url' => route('customer_mail_detail', [$customer_mail->id, 'move-mail-fewo']), 'class' => 'move-mail-form']) !!}
@ -140,6 +140,23 @@
</div>
</div>
{!! Form::close() !!}
<hr>
{!! Form::open(['url' => route('customer_mail_detail', [$customer_mail->id, 'forward_fewo-email']), 'class' => 'forward-mail-form']) !!}
<div class="form-row">
<div class="col-sm-6">
<label for="customer_mail_forward_email" class="form-label">E-Mail weiterleiten:</label>
{{ Form::text('customer_mail_forward_email', $customer_mail->email, array('placeholder'=>'E-Mail', 'id'=>'customer_mail_forward_email', 'class'=>'form-control', 'required')) }}
</div>
<div class="col-sm-6">
<button type="submit" class="btn btn-xs btn-default float-right mt-1" onclick="return confirm('{{__('Wirklich weiterleiten? E-Mail wird erneut gesendet!')}}');"><i class="ion ion-ios-send"></i>&nbsp; weiterleiten</button>
</div
</div>
{!! Form::close() !!}
</div>
@endif
</div>
</div>
@if(isset($customer_mail->customer_mail))
<hr>
@include('travel.user.booking.mail.modal-show-mail-inner', ['customer_mail' => $customer_mail->customer_mail, 'show_move_dirs' => false])
@endif

View file

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

View file

@ -32,4 +32,5 @@ Route::group(['middleware' => 'auth:api'], function(){
Route::post('draft/{action}', 'API\DraftController@draft');
Route::post('load/{action}', 'API\LoaderController@load');
Route::post('fewo/{action}', 'API\FewoController@action');
Route::post('lead/{action}', 'API\LeadController@action');
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB