diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php
index 73e6d19..766704e 100755
--- a/app/Http/Controllers/HomeController.php
+++ b/app/Http/Controllers/HomeController.php
@@ -44,9 +44,9 @@ class HomeController extends Controller
return redirect('login');
}
- $last_booking_notices = BookingNotice::orderBy('edit_at', 'DESC')->orderBy('created_at', 'DESC')->limit(10)->get();
- $last_booking_fewo_notices = TravelUserBookingFewoNotice::orderBy('edit_at', 'DESC')->orderBy('created_at', 'DESC')->limit(10)->get();
- $last_lead_notices = LeadNotice::orderBy('edit_at', 'DESC')->orderBy('created_at', 'DESC')->limit(10)->get();
+ $last_booking_notices = BookingNotice::orderBy('updated_at', 'DESC')->limit(10)->get();
+ $last_booking_fewo_notices = TravelUserBookingFewoNotice::orderBy('updated_at', 'DESC')->limit(10)->get();
+ $last_lead_notices = LeadNotice::orderBy('updated_at', 'DESC')->limit(10)->get();
$data = [
diff --git a/app/Http/Controllers/IQ/ItemController.php b/app/Http/Controllers/IQ/ItemController.php
new file mode 100644
index 0000000..9beaf2c
--- /dev/null
+++ b/app/Http/Controllers/IQ/ItemController.php
@@ -0,0 +1,31 @@
+ [],
+ 'lfm_helper' => $this->helper,
+ 'modal' => false,
+ ];
+ return view('iq.content.assets.index', $data);
+ }
+
+ public function modal(){
+ $data = [
+ 'models' => [],
+ 'lfm_helper' => $this->helper,
+ 'modal' => true,
+ ];
+ return view('iq.content.assets.body', $data);
+ }
+}
diff --git a/app/Http/Controllers/IQ/TravelGroupController.php b/app/Http/Controllers/IQ/TravelGroupController.php
new file mode 100644
index 0000000..38c33e3
--- /dev/null
+++ b/app/Http/Controllers/IQ/TravelGroupController.php
@@ -0,0 +1,126 @@
+middleware('admin');
+ $this->tavelRepo = $tavelRepo;
+ }
+
+ public function index()
+ {
+ $data = [
+
+ ];
+ return view('iq.travel.group.index', $data);
+ }
+
+
+ public function detail($id, $step = false)
+ {
+ if($id === "new") {
+ $model = new IQTravelGroup();
+ $id = 'new';
+ $model->active = 1;
+ }else{
+ $model = IQTravelGroup::findOrFail($id);
+ $id = $model->id;
+ }
+
+ $data = [
+ 'model' => $model,
+ 'id' => $id,
+
+ ];
+ return view('iq.travel.group.detail', $data);
+ }
+
+
+ public function store($id)
+ {
+ $data = Request::all();
+ if(isset($data['action'])){
+ if($data['action'] === 'saveAll'){
+ $travel_group = $this->tavelRepo->updateTravelGroup($id, $data);
+ \Session()->flash('alert-save', '1');
+ return redirect(route('iq_travel_group_detail', [$travel_group->id]));
+
+ }
+ if($data['action'] === 'save-iq_travel_item_group'){
+ $travel_group_item = $this->tavelRepo->updateTravelGroupItem($id, $data);
+ \Session()->flash('alert-save', '1');
+ return redirect(route('iq_travel_group_detail', [$id]));
+
+ }
+ }
+ return redirect()->back();
+ }
+
+ public function delete($id, $del=false){
+
+ if($del === 'i_q_travel_group_item'){
+ $IQTravelGroupItem = IQTravelGroupItem::findOrFail($id);
+ $r_id = $IQTravelGroupItem->i_q_travel_group_id;
+ //TODO check need ???
+ $IQTravelGroupItem->delete();
+ \Session()->flash('alert-success', __('Eintrag gelöscht'));
+ return redirect(route('iq_travel_group_detail', [$r_id]));
+ }
+ if($del === 'iq_travel_group'){
+ $IQTravelGroup = IQTravelGroup::findOrFail($id);
+ //TODO check need ???
+ $IQTravelGroup->delete();
+ \Session()->flash('alert-success', __('Eintrag gelöscht'));
+ return redirect(route('iq_travel_groups'));
+ }
+
+ return back();
+ }
+
+ public function getTravelGroups()
+ {
+ $query = IQTravelGroup::with('i_q_travel_group_items')->with('i_q_travel_group_items.i_q_travel_item')->select('i_q_travel_groups.*');
+
+ return \DataTables::eloquent($query)
+ ->addColumn('action_edit', function (IQTravelGroup $iq_travel_group) {
+ return '';
+ })
+ ->addColumn('trave_items', function (IQTravelGroup $iq_travel_group) {
+ $ret = "";
+ if($iq_travel_group->i_q_travel_group_items->count()){
+ foreach($iq_travel_group->i_q_travel_group_items as $i_q_travel_group_item){
+ $ret .= $i_q_travel_group_item->i_q_travel_item->name;
+ $ret .= $i_q_travel_group_item->i_q_travel_item->draft_type_id ? ' | '.$i_q_travel_group_item->i_q_travel_item->draft_type->name.'' : '';
+
+
+ $ret .= "
";
+ }
+ $ret = rtrim($ret, '
');
+ }
+ return $ret;
+ })
+ ->addColumn('active', function (IQTravelGroup $iq_travel_group) {
+ return get_active_badge($iq_travel_group->active);
+ })
+ ->addColumn('action_delete', function (IQTravelGroup $iq_travel_group) {
+ return '';
+ })
+ ->orderColumn('id', 'id $1')
+ ->rawColumns(['action_edit', 'id', 'active', 'trave_items', 'action_delete'])
+ ->make(true);
+ }
+}
diff --git a/app/Http/Controllers/IQ/TravelItemController.php b/app/Http/Controllers/IQ/TravelItemController.php
new file mode 100644
index 0000000..3739a4e
--- /dev/null
+++ b/app/Http/Controllers/IQ/TravelItemController.php
@@ -0,0 +1,136 @@
+middleware('admin');
+ $this->tavelRepo = $tavelRepo;
+ }
+
+ public function index()
+ {
+ $data = [
+
+ ];
+ return view('iq.travel.item.index', $data);
+ }
+
+
+ public function detail($id, $step = false)
+ {
+ if($id === "new") {
+ $model = new IQTravelItem();
+ $id = 'new';
+ $model->active = 1;
+ }else{
+ $model = IQTravelItem::findOrFail($id);
+ $id = $model->id;
+ }
+
+ $data = [
+ 'model' => $model,
+ 'id' => $id,
+
+ ];
+ return view('iq.travel.item.detail', $data);
+ }
+
+
+ public function store($id)
+ {
+ $data = Request::all();
+ if(isset($data['action'])){
+ if($data['action'] === 'saveAll'){
+ $travel_item = $this->tavelRepo->updateTravelItem($id, $data);
+ \Session()->flash('alert-save', '1');
+ return redirect(route('iq_travel_item_detail', [$travel_item->id]));
+
+ }
+ if($data['action'] === 'save-iq_travel_item_place'){
+ $travel_item_place = $this->tavelRepo->updateTravelItemPlace($id, $data);
+ \Session()->flash('alert-save', '1');
+ return redirect(route('iq_travel_item_detail', [$id]));
+
+ }
+ }
+ return redirect()->back();
+ }
+
+ public function delete($id, $del=false){
+ if($del === 'i_q_travel_item_place'){
+ $IQTravelItemPlace = IQTravelItemPlace::findOrFail($id);
+ $r_id = $IQTravelItemPlace->i_q_travel_item_id;
+ //TODO check need ???
+ $IQTravelItemPlace->delete();
+ \Session()->flash('alert-success', __('Eintrag gelöscht'));
+ return redirect(route('iq_travel_item_detail', [$r_id]));
+ }
+ if($del === 'iq_travel_item'){
+ $IQTravelItem = IQTravelItem::findOrFail($id);
+ //TODO check need ???
+ $IQTravelItem->delete();
+ \Session()->flash('alert-success', __('Eintrag gelöscht'));
+ return redirect(route('iq_travel_items'));
+ }
+
+
+ return back();
+ }
+
+ public function getTravelItems()
+ {
+ $query = IQTravelItem::with('draft_type')->with('i_q_travel_item_places')->select('i_q_travel_items.*');
+
+ return \DataTables::eloquent($query)
+ ->addColumn('action_edit', function (IQTravelItem $iq_travel_item) {
+ return '';
+ })
+ ->addColumn('draft_type', function (IQTravelItem $iq_travel_item) {
+ return $iq_travel_item->draft_type ? ''.$iq_travel_item->draft_type->name.'' : '';
+ })
+ ->addColumn('country', function (IQTravelItem $iq_travel_item) {
+ return $iq_travel_item->travel_country ? $iq_travel_item->travel_country->name : '';
+ })
+ ->addColumn('trave_places', function (IQTravelItem $iq_travel_item) {
+ $ret = "";
+ if($iq_travel_item->i_q_travel_item_places->count()){
+ foreach($iq_travel_item->i_q_travel_item_places as $i_q_travel_item_place){
+ $ret .= $i_q_travel_item_place->travel_place->name."
";
+ }
+ $ret = rtrim($ret, '
');
+ }
+ return $ret;
+ })
+ ->addColumn('active', function (IQTravelItem $iq_travel_item) {
+ return get_active_badge($iq_travel_item->active);
+ })
+ /*
+ ->filterColumn('draft_type', function ($query, $keyword) {
+ if ($keyword != "") {
+ $query->whereHas('draft_type', function ($q) use ($keyword) {
+ $q->where("name", 'LIKE', '%' . $keyword . '%');
+ });
+ }
+ })
+ */
+ ->addColumn('action_delete', function (IQTravelItem $iq_travel_item) {
+ return '';
+ })
+ ->orderColumn('id', 'id $1')
+ ->rawColumns(['action_edit', 'id', 'active', 'draft_type', 'trave_places', 'action_delete'])
+ ->make(true);
+ }
+}
diff --git a/app/Http/Controllers/IQ/TravelProgrammController.php b/app/Http/Controllers/IQ/TravelProgrammController.php
new file mode 100644
index 0000000..f952ef0
--- /dev/null
+++ b/app/Http/Controllers/IQ/TravelProgrammController.php
@@ -0,0 +1,126 @@
+middleware('admin');
+ $this->tavelRepo = $tavelRepo;
+ }
+
+ public function index()
+ {
+ $data = [
+
+ ];
+ return view('iq.travel.programm.index', $data);
+ }
+
+
+ public function detail($id, $step = false)
+ {
+ if($id === "new") {
+ $model = new IQTravelGroup();
+ $id = 'new';
+ $model->active = 1;
+ }else{
+ $model = IQTravelGroup::findOrFail($id);
+ $id = $model->id;
+ }
+
+ $data = [
+ 'model' => $model,
+ 'id' => $id,
+
+ ];
+ return view('iq.travel.group.detail', $data);
+ }
+
+
+ public function store($id)
+ {
+ $data = Request::all();
+ if(isset($data['action'])){
+ if($data['action'] === 'saveAll'){
+ $travel_group = $this->tavelRepo->updateTravelGroup($id, $data);
+ \Session()->flash('alert-save', '1');
+ return redirect(route('iq_travel_group_detail', [$travel_group->id]));
+
+ }
+ if($data['action'] === 'save-iq_travel_item_group'){
+ $travel_group_item = $this->tavelRepo->updateTravelGroupItem($id, $data);
+ \Session()->flash('alert-save', '1');
+ return redirect(route('iq_travel_group_detail', [$id]));
+
+ }
+ }
+ return redirect()->back();
+ }
+
+ public function delete($id, $del=false){
+
+ if($del === 'i_q_travel_group_item'){
+ $IQTravelGroupItem = IQTravelGroupItem::findOrFail($id);
+ $r_id = $IQTravelGroupItem->i_q_travel_group_id;
+ //TODO check need ???
+ $IQTravelGroupItem->delete();
+ \Session()->flash('alert-success', __('Eintrag gelöscht'));
+ return redirect(route('iq_travel_group_detail', [$r_id]));
+ }
+ if($del === 'iq_travel_group'){
+ $IQTravelGroup = IQTravelGroup::findOrFail($id);
+ //TODO check need ???
+ $IQTravelGroup->delete();
+ \Session()->flash('alert-success', __('Eintrag gelöscht'));
+ return redirect(route('iq_travel_groups'));
+ }
+
+ return back();
+ }
+
+ public function getTravelGroups()
+ {
+ $query = IQTravelGroup::with('i_q_travel_group_items')->with('i_q_travel_group_items.i_q_travel_item')->select('i_q_travel_groups.*');
+
+ return \DataTables::eloquent($query)
+ ->addColumn('action_edit', function (IQTravelGroup $iq_travel_group) {
+ return '';
+ })
+ ->addColumn('trave_items', function (IQTravelGroup $iq_travel_group) {
+ $ret = "";
+ if($iq_travel_group->i_q_travel_group_items->count()){
+ foreach($iq_travel_group->i_q_travel_group_items as $i_q_travel_group_item){
+ $ret .= $i_q_travel_group_item->i_q_travel_item->name;
+ $ret .= $i_q_travel_group_item->i_q_travel_item->draft_type_id ? ' | '.$i_q_travel_group_item->i_q_travel_item->draft_type->name.'' : '';
+
+
+ $ret .= "
";
+ }
+ $ret = rtrim($ret, '
');
+ }
+ return $ret;
+ })
+ ->addColumn('active', function (IQTravelGroup $iq_travel_group) {
+ return get_active_badge($iq_travel_group->active);
+ })
+ ->addColumn('action_delete', function (IQTravelGroup $iq_travel_group) {
+ return '';
+ })
+ ->orderColumn('id', 'id $1')
+ ->rawColumns(['action_edit', 'id', 'active', 'trave_items', 'action_delete'])
+ ->make(true);
+ }
+}
diff --git a/app/Http/Controllers/ModalController.php b/app/Http/Controllers/ModalController.php
index c19ad2f..7165eb7 100644
--- a/app/Http/Controllers/ModalController.php
+++ b/app/Http/Controllers/ModalController.php
@@ -2,14 +2,16 @@
namespace App\Http\Controllers;
+use Request;
use App\Models\GeneralFile;
use App\Models\IQContentSite;
-use App\Models\ServiceProviderService;
-use App\Models\TravelCompanyService;
use App\Models\TravelCountry;
+use App\Models\IQTravelGroupItem;
+use App\Models\IQTravelItemPlace;
+use App\Models\TravelCompanyService;
use App\Models\TravelCountryService;
+use App\Models\ServiceProviderService;
use App\Repositories\GeneralFileRepository;
-use Request;
class ModalController extends Controller
{
@@ -70,6 +72,29 @@ class ModalController extends Controller
}
$ret = view("admin.modal.provider-service", compact('data', 'value'))->render();
}
+
+ if($data['action'] === 'modal-iq_travel_item-place'){
+ if($data['id'] === 'new'){
+ $value = new IQTravelItemPlace();
+ $value->pos = 0;
+ }else{
+ $value = IQTravelItemPlace::find($data['id']);
+ }
+ $ret = view("admin.modal.iq_travel_item-place", compact('data', 'value'))->render();
+ }
+
+ if($data['action'] === 'modal-iq_travel_item-group'){
+ if($data['id'] === 'new'){
+ $value = new IQTravelGroupItem();
+ $value->pos = 0;
+ }else{
+ $value = IQTravelGroupItem::find($data['id']);
+ }
+ $ret = view("admin.modal.iq_travel_group-item", compact('data', 'value'))->render();
+ }
+
+
+
}
return response()->json(['response' => $data, 'html'=>$ret, 'status'=>$status]);
}
diff --git a/app/Http/Controllers/Settings/TravelPlaceController.php b/app/Http/Controllers/Settings/TravelPlaceController.php
new file mode 100644
index 0000000..aa7de21
--- /dev/null
+++ b/app/Http/Controllers/Settings/TravelPlaceController.php
@@ -0,0 +1,58 @@
+middleware('admin');
+ }
+
+ public function index($step = false)
+ {
+ $data = [
+ 'travel_places' => TravelPlace::all(),
+ ];
+ return view('settings.place.index', $data);
+ }
+
+
+ public function update(){
+
+ $data = Request::all();
+
+
+ $data['active'] = isset($data['active']) ? true : false;
+
+ if($data['id'] === "new"){
+ $model = TravelPlace::create($data);
+ }else{
+ $model = TravelPlace::find($data['id']);
+ $model->fill($data);
+ $model->save();
+ }
+
+ \Session()->flash('alert-save', '1');
+ return redirect(route('admin_settings_travel_places'));
+ }
+
+ public function delete($id){
+ //TODO check ist linked
+
+ $model = TravelPlace::findOrFail($id);
+ $model->delete();
+ \Session()->flash('alert-success', 'Eintrag gelöscht');
+ return redirect()->back();
+ }
+
+}
+
+
diff --git a/app/Models/Booking.php b/app/Models/Booking.php
index dbb1068..8c33dd0 100644
--- a/app/Models/Booking.php
+++ b/app/Models/Booking.php
@@ -533,7 +533,7 @@ class Booking extends Model
public function booking_notices()
{
- return $this->hasMany(BookingNotice::class, 'booking_id')->orderBy('created_at', 'DESC');
+ return $this->hasMany(BookingNotice::class, 'booking_id')->orderBy('updated_at', 'DESC');
}
public function booking_strono()
diff --git a/app/Models/IQTravelGroup.php b/app/Models/IQTravelGroup.php
new file mode 100644
index 0000000..df9fab7
--- /dev/null
+++ b/app/Models/IQTravelGroup.php
@@ -0,0 +1,107 @@
+ 'int',
+ 'days_duration' => 'int',
+ 'min_persons' => 'int',
+ 'price_adult' => 'float',
+ 'price_children' => 'float',
+ 'pos' => 'int',
+ 'active' => 'bool'
+ ];
+
+ protected $fillable = [
+ 'name',
+ 'description',
+ 'highlights',
+ 'days_start',
+ 'days_duration',
+ 'min_persons',
+ 'price_adult',
+ 'price_children',
+ 'pos',
+ 'active'
+ ];
+
+ public function i_q_travel_group_items()
+ {
+ return $this->hasMany(IQTravelGroupItem::class)->orderBy('pos', 'DESC');
+ }
+
+
+ //price_adult
+ public function getPriceAdultAttribute()
+ {
+ return isset($this->attributes['price_adult']) ? Util::_number_format($this->attributes['price_adult']) : null;
+ }
+ public function setPriceAdultAttribute($value)
+ {
+ $this->attributes['price_adult'] = $value ? Util::_clean_float($value) : null;
+ }
+ public function getPriceAdultRaw()
+ {
+
+ return isset($this->attributes['price_adult']) ? $this->attributes['price_adult'] : 0;
+ }
+ public function setPriceAdultRaw($value)
+ {
+ return $this->attributes['price_adult'] = $value;
+ }
+
+
+ //price_children
+ public function getPriceChildrenAttribute()
+ {
+ return isset($this->attributes['price_children']) ? Util::_number_format($this->attributes['price_children']) : null;
+ }
+ public function setPriceChildrenAttribute($value)
+ {
+ $this->attributes['price_children'] = $value ? Util::_clean_float($value) : null;
+ }
+ public function getPriceChildrenRaw()
+ {
+ return isset($this->attributes['price_children']) ? $this->attributes['price_children'] : 0;
+ }
+ public function setPriceChildrenRaw($value)
+ {
+ return $this->attributes['price_children'] = $value;
+ }
+}
diff --git a/app/Models/IQTravelGroupItem.php b/app/Models/IQTravelGroupItem.php
new file mode 100644
index 0000000..d5cc52d
--- /dev/null
+++ b/app/Models/IQTravelGroupItem.php
@@ -0,0 +1,55 @@
+ 'int',
+ 'i_q_travel_item_id' => 'int',
+ 'pos' => 'int',
+
+ ];
+
+ protected $fillable = [
+ 'i_q_travel_group_id',
+ 'i_q_travel_item_id',
+ 'pos',
+ ];
+
+ public function i_q_travel_group()
+ {
+ return $this->belongsTo(IQTravelGroup::class);
+ }
+
+ public function i_q_travel_item()
+ {
+ return $this->belongsTo(IQTravelItem::class);
+ }
+}
diff --git a/app/Models/IQTravelItem.php b/app/Models/IQTravelItem.php
new file mode 100644
index 0000000..d55e7f5
--- /dev/null
+++ b/app/Models/IQTravelItem.php
@@ -0,0 +1,131 @@
+ 'int',
+ 'travel_country_id' => 'int',
+ 'days_start' => 'int',
+ 'days_duration' => 'int',
+ 'min_persons' => 'int',
+ 'price_adult' => 'float',
+ 'price_children' => 'float',
+ 'pos' => 'int',
+ 'active' => 'bool'
+ ];
+
+ protected $fillable = [
+ 'name',
+ 'description',
+ 'highlights',
+ 'draft_type_id',
+ 'travel_country_id',
+ 'days_start',
+ 'days_duration',
+ 'min_persons',
+ 'price_adult',
+ 'price_children',
+ 'pos',
+ 'active'
+ ];
+
+ public function travel_country()
+ {
+ return $this->belongsTo(TravelCountry::class);
+ }
+
+ public function i_q_travel_group_items()
+ {
+ return $this->hasMany(IQTravelGroupItem::class);
+ }
+
+ public function i_q_travel_item_places()
+ {
+ return $this->hasMany(IQTravelItemPlace::class)->orderBy('pos', 'DESC');
+ }
+
+ public function draft_type()
+ {
+ return $this->belongsTo(DraftType::class, 'draft_type_id');
+ }
+
+
+
+ //price_adult
+ public function getPriceAdultAttribute()
+ {
+ return isset($this->attributes['price_adult']) ? Util::_number_format($this->attributes['price_adult']) : null;
+ }
+ public function setPriceAdultAttribute($value)
+ {
+ $this->attributes['price_adult'] = $value ? Util::_clean_float($value) : null;
+ }
+ public function getPriceAdultRaw()
+ {
+
+ return isset($this->attributes['price_adult']) ? $this->attributes['price_adult'] : 0;
+ }
+ public function setPriceAdultRaw($value)
+ {
+ return $this->attributes['price_adult'] = $value;
+ }
+
+
+ //price_children
+ public function getPriceChildrenAttribute()
+ {
+ return isset($this->attributes['price_children']) ? Util::_number_format($this->attributes['price_children']) : null;
+ }
+ public function setPriceChildrenAttribute($value)
+ {
+ $this->attributes['price_children'] = $value ? Util::_clean_float($value) : null;
+ }
+ public function getPriceChildrenRaw()
+ {
+ return isset($this->attributes['price_children']) ? $this->attributes['price_children'] : 0;
+ }
+ public function setPriceChildrenRaw($value)
+ {
+ return $this->attributes['price_children'] = $value;
+ }
+}
diff --git a/app/Models/IQTravelItemPlace.php b/app/Models/IQTravelItemPlace.php
new file mode 100644
index 0000000..79b55f5
--- /dev/null
+++ b/app/Models/IQTravelItemPlace.php
@@ -0,0 +1,54 @@
+ 'int',
+ 'travel_place_id' => 'int',
+ 'pos' => 'int',
+ ];
+
+ protected $fillable = [
+ 'i_q_travel_item_id',
+ 'travel_place_id',
+ 'pos',
+ ];
+
+ public function i_q_travel_item()
+ {
+ return $this->belongsTo(IQTravelItem::class);
+ }
+
+ public function travel_place()
+ {
+ return $this->belongsTo(TravelPlace::class);
+ }
+}
diff --git a/app/Models/Lead.php b/app/Models/Lead.php
index 77cfd99..32770fd 100644
--- a/app/Models/Lead.php
+++ b/app/Models/Lead.php
@@ -277,7 +277,7 @@ class Lead extends Model
public function lead_notices()
{
- return $this->hasMany(LeadNotice::class, 'lead_id')->orderBy('created_at', 'DESC');
+ return $this->hasMany(LeadNotice::class, 'lead_id')->orderBy('updated_at', 'DESC');
}
diff --git a/app/Models/TravelCountry.php b/app/Models/TravelCountry.php
index 047f0c3..fcb1537 100644
--- a/app/Models/TravelCountry.php
+++ b/app/Models/TravelCountry.php
@@ -166,7 +166,7 @@ class TravelCountry extends Model
public function getContactLandsModels(){
$ret = [];
if($this->contact_lands){
- foreach ($this->contact_lands as $travel_country_id){
+ foreach ($this->contact_lands as $contact_land_id){
if($travel_country = TravelCountry::where('crm_id', $contact_land_id)->first()){
$ret[$travel_country->id] = $travel_country;
}
diff --git a/app/Models/TravelPlace.php b/app/Models/TravelPlace.php
new file mode 100644
index 0000000..356c932
--- /dev/null
+++ b/app/Models/TravelPlace.php
@@ -0,0 +1,54 @@
+ 'int',
+ 'latitude' => 'float',
+ 'longitude' => 'float',
+ 'active' => 'bool'
+ ];
+
+ protected $fillable = [
+ 'name',
+ 'description',
+ 'travel_country_id',
+ 'latitude',
+ 'longitude',
+ 'active'
+ ];
+
+ public function travel_country()
+ {
+ return $this->belongsTo(TravelCountry::class);
+ }
+}
diff --git a/app/Models/TravelUserBookingFewo.php b/app/Models/TravelUserBookingFewo.php
index 2c10eac..93ad8c1 100644
--- a/app/Models/TravelUserBookingFewo.php
+++ b/app/Models/TravelUserBookingFewo.php
@@ -253,7 +253,7 @@ class TravelUserBookingFewo extends Model
public function booking_fewo_notices()
{
- return $this->hasMany(TravelUserBookingFewoNotice::class, 'travel_user_booking_fewo_id')->orderBy('created_at', 'DESC');
+ return $this->hasMany(TravelUserBookingFewoNotice::class, 'travel_user_booking_fewo_id')->orderBy('updated_at', 'DESC');
}
public function getStatuesName(){
diff --git a/app/Repositories/IQ/ContentSiteRepository.php b/app/Repositories/IQ/ContentSiteRepository.php
index f9b3447..1d7b168 100644
--- a/app/Repositories/IQ/ContentSiteRepository.php
+++ b/app/Repositories/IQ/ContentSiteRepository.php
@@ -46,7 +46,7 @@ class ContentSiteRepository extends BaseRepository {
$site_field = false;
// $site_field = IQContentSiteField::getSiteFieldOrNew($contentSite->id, $model_field->id);
//new
- if(!$site_field->id){
+ /*if(!$site_field->id){
$site_field->site_id = $contentSite->id;
$site_field->model_field_id = $model_field->id;
$site_field->field = $model_field->field;
@@ -57,7 +57,7 @@ class ContentSiteRepository extends BaseRepository {
}else{
- }
+ }*/
$ret[] = $site_field;
}
diff --git a/app/Repositories/IQ/TravelRepository.php b/app/Repositories/IQ/TravelRepository.php
new file mode 100644
index 0000000..cd2700d
--- /dev/null
+++ b/app/Repositories/IQ/TravelRepository.php
@@ -0,0 +1,89 @@
+model = null;
+ }
+
+
+
+
+
+ public function updateTravelGroup($id, $data)
+ {
+
+ if($id == "new"){
+ $this->model = IQTravelGroup::create($data);
+ }
+ else{
+ $this->model = IQTravelGroup::findOrFail($id);
+ $this->model->fill($data);
+ $this->model->save();
+ }
+
+ return $this->model;
+ }
+
+ public function updateTravelGroupItem($id, $data)
+ {
+ $data['pos'] = $data['pos'] ? intval($data['pos']) : 0;
+ $data['i_q_travel_group_id'] = $data['iq_travel_group_id'];
+
+ if($data['iq_travel_group_item_id'] == "new"){
+ $this->model = IQTravelGroupItem::create($data);
+ }
+ else{
+ $this->model = IQTravelGroupItem::findOrFail($data['iq_travel_group_item_id']);
+ $this->model->fill($data);
+ $this->model->save();
+ }
+ return $this->model;
+ }
+
+
+
+ public function updateTravelItem($id, $data)
+ {
+ $data['draft_type_id'] = $data['draft_type_id'] ? $data['draft_type_id'] : null;
+ $data['travel_country_id'] = $data['travel_country_id'] ? $data['travel_country_id'] : null;
+
+ if($id == "new"){
+ $this->model = IQTravelItem::create($data);
+ }
+ else{
+ $this->model = IQTravelItem::findOrFail($id);
+ $this->model->fill($data);
+ $this->model->save();
+ }
+
+ return $this->model;
+ }
+
+ public function updateTravelItemPlace($id, $data)
+ {
+ $data['pos'] = $data['pos'] ? intval($data['pos']) : 0;
+ $data['i_q_travel_item_id'] = $data['iq_travel_item_id'];
+ if($data['iq_travel_item_place_id'] == "new"){
+ $this->model = IQTravelItemPlace::create($data);
+ }
+ else{
+ $this->model = IQTravelItemPlace::findOrFail($data['iq_travel_item_place_id']);
+ $this->model->fill($data);
+ $this->model->save();
+ }
+
+ return $this->model;
+ }
+
+}
\ No newline at end of file
diff --git a/app/Services/HTMLHelper.php b/app/Services/HTMLHelper.php
index 2462ae4..bcd0863 100644
--- a/app/Services/HTMLHelper.php
+++ b/app/Services/HTMLHelper.php
@@ -9,12 +9,14 @@ use App\Models\Draft;
use App\Models\DraftType;
use App\Models\FewoLodging;
use App\Models\Insurance;
+use App\Models\IQTravelItem;
use App\Models\TravelBookingFewoChannel;
use App\Models\TravelClass;
use App\Models\TravelCompany;
use App\Models\TravelCountry;
use App\Models\TravelGuide;
use App\Models\TravelNationality;
+use App\Models\TravelPlace;
use App\Models\TravelProgram;
use App\Models\TravelUser;
use Form;
@@ -238,7 +240,7 @@ class HTMLHelper
return $ret;
}
- public static function getTravelCountriesOptions($countryId = false){
+ public static function getTravelCountriesOptions($countryId = false, $crm = true){
$checked = [];
if($countryId){
!is_array($countryId) ? $checked = array($countryId) : $checked = $countryId;
@@ -246,15 +248,15 @@ class HTMLHelper
$options = TravelCountry::where('active_backend',1)->get();
$ret = '';
foreach ($options as $option){
- $attr = (in_array($option->crm_id, $checked)) ? 'selected="selected"' : '';
- $ret .= '\n';
+ $id = $crm ? $option->crm_id : $option->id;
+ $attr = (in_array($id, $checked)) ? 'selected="selected"' : '';
+ $ret .= '\n';
}
return $ret;
}
public static function getTravelUserOptions($id = false, $order = "ASC", $empty=false){
$options = TravelUser::orderBy('id', $order)->get();
-
$ret = '';
if($empty){
$ret = '\n';
@@ -267,6 +269,33 @@ class HTMLHelper
return $ret;
}
+ public static function getTravelPlaceOptions($id = false, $order = "ASC", $empty=false){
+ $options = TravelPlace::where('active',1)->orderBy('id', $order)->get();
+ $ret = '';
+ if($empty){
+ $ret = '\n';
+ }
+
+ foreach ($options as $option){
+ $attr = ($option->id === $id) ? 'selected="selected"' : '';
+ $ret .= '\n';
+ }
+ return $ret;
+ }
+
+ public static function getIQTravelItemsOptions($id = false, $order = "ASC", $empty=false){
+ $options = IQTravelItem::where('active',1)->orderBy('id', $order)->get();
+ $ret = '';
+ if($empty){
+ $ret = '\n';
+ }
+ foreach ($options as $option){
+ $attr = ($option->id === $id) ? 'selected="selected"' : '';
+ $ret .= '\n';
+ }
+ return $ret;
+ }
+
public static function getCustomerMailDirsOptions(CMSContent $customer_mail_dir, $checked = []){
//$checked = [];
$model = $customer_mail_dir->getArrayContent('model');
diff --git a/app/Services/Model.php b/app/Services/Model.php
index cc973a1..10d64a1 100644
--- a/app/Services/Model.php
+++ b/app/Services/Model.php
@@ -3,6 +3,7 @@ namespace App\Services;
use App\Models\Branch;
use App\Models\Status;
+use App\Models\DraftType;
use App\Models\Salutation;
use App\Models\SfGuardUser;
use App\Models\TravelAgenda;
@@ -75,6 +76,11 @@ class Model
$TravelNationality = TravelNationality::where('active', true)->orderBy('name')->get()->pluck('name', 'id');
return $emtpy ? $TravelNationality->prepend('-', 0) : $TravelNationality;
}
+
+ public static function getDraftTypeArray($emtpy = false){
+ $DraftType = DraftType::where('active', true)->orderByDesc('pos')->get()->pluck('name', 'id');
+ return $emtpy ? $DraftType->prepend('-', 0) : $DraftType;
+ }
diff --git a/config/permissions.php b/config/permissions.php
index ef63242..642a676 100755
--- a/config/permissions.php
+++ b/config/permissions.php
@@ -18,10 +18,14 @@ return [
'crm-cm' => ['name' => 'ADMIN CRM > Kundenverwaltung' , 'color' => 'admin'],
'crm-cm-cf' => ['name' => 'ADMIN CRM > Kundenverwaltung > Kunden (FeWo)' , 'color' => 'admin'],
'crm-cm-bf' => ['name' => 'ADMIN CRM > Kundenverwaltung > Buchungen (FeWo)' , 'color' => 'admin'],
- 'crm-mail' => ['name' => 'ADMIN CRM > E-Mails' , 'color' => 'admin'],
+ 'crm-mail' => ['name' => 'ADMIN CRM > E-Mails' , 'color' => 'admin'],
'crm-mail-le' => ['name' => 'ADMIN CRM > E-Mails > Anfragen' , 'color' => 'admin'],
'crm-mail-bo' => ['name' => 'ADMIN CRM > E-Mails > Buchungen' , 'color' => 'admin'],
'crm-mail-bf' => ['name' => 'ADMIN CRM > E-Mails > Buchungen (Fewo)' , 'color' => 'admin'],
+ 'crm-iq-tl' => ['name' => 'ADMIN CRM > Reisebausteine' , 'color' => 'admin'],
+ 'crm-iq-tl-pro' => ['name' => 'ADMIN CRM > Reisebausteine > Programm' , 'color' => 'admin'],
+ 'crm-iq-tl-gp' => ['name' => 'ADMIN CRM > Reisebausteine > Gruppe' , 'color' => 'admin'],
+ 'crm-iq-tl-it' => ['name' => 'ADMIN CRM > Reisebausteine > Baustein' , 'color' => 'admin'],
'crm-old-cm' => ['name' => 'ADMIN CRM altes System > Kundenverwaltung' , 'color' => 'info'],
'cms' => ['name' => 'ADMIN CMS' , 'color' => 'secondary'],
'cms-iq-assets' => ['name' => 'ADMIN CMS > Medien' , 'color' => 'secondary'],
@@ -36,8 +40,8 @@ return [
'cms-cn-au' => ['name' => 'ADMIN CMS > Inhalte > Autor' , 'color' => 'secondary'],
],
2 => [
- 'sua-bo-n-edit' => ['name' => 'SUPERADMIN > Buchungen > Notizen > bearbeiten' , 'color' => 'secondary'],
- 'sua-fewo-n-edit' => ['name' => 'SUPERADMIN > FeWo > Notizen > bearbeiten' , 'color' => 'secondary'],
+ 'sua-bo-n-edit' => ['name' => 'SUPERADMIN > Buchungen > Notizen > bearbeiten' , 'color' => 'secondary'],
+ 'sua-fewo-n-edit' => ['name' => 'SUPERADMIN > FeWo > Notizen > bearbeiten' , 'color' => 'secondary'],
'sua-st' => ['name' => 'SUPERADMIN > Einstellungen' , 'color' => 'superadmin'],
'sua-st-al' => ['name' => 'SUPERADMIN > Einstellungen > Airline' , 'color' => 'superadmin'],
'sua-st-em' => ['name' => 'SUPERADMIN > Einstellungen > E-Mails' , 'color' => 'superadmin'],
@@ -45,7 +49,8 @@ return [
'sua-st-sp' => ['name' => 'SUPERADMIN > Einstellungen > Leistungsträger' , 'color' => 'superadmin'],
'sua-st-tn' => ['name' => 'SUPERADMIN > Einstellungen > Nationalitäten' , 'color' => 'superadmin'],
'sua-st-co' => ['name' => 'SUPERADMIN > Einstellungen > Reiseländer' , 'color' => 'superadmin'],
- 'sua-st-tp' => ['name' => 'SUPERADMIN > Einstellungen > Reisprogramme' , 'color' => 'superadmin'],
+ 'sua-st-tp' => ['name' => 'SUPERADMIN > Einstellungen > Reiseprogramme' , 'color' => 'superadmin'],
+ 'sua-st-tpl' => ['name' => 'SUPERADMIN > Einstellungen > Reiseorte' , 'color' => 'superadmin'],
'sua-st-bs' => ['name' => 'SUPERADMIN > Einstellungen > Reisestatus' , 'color' => 'superadmin'],
'sua-st-tc' => ['name' => 'SUPERADMIN > Einstellungen > Veranstalter' , 'color' => 'superadmin'],
'sua-st-in' => ['name' => 'SUPERADMIN > Einstellungen > Versicherungen' , 'color' => 'superadmin'],
@@ -55,7 +60,6 @@ return [
'sua-re-pp' => ['name' => 'SUPERADMIN > Export > Leistungsträger' , 'color' => 'superadmin'],
'sua-ur-rt' => ['name' => 'SUPERADMIN > User Rechte' , 'color' => 'danger'],
'cms-cn-co' => ['name' => 'ADMIN CMS > Inhalte > Länder' , 'color' => 'secondary'],
-
],
],
'roles' => [
diff --git a/database/migrations/2018_10_19_114521_create_draft_items_table.php b/database/migrations/2018_10_19_114521_create_draft_items_table.php
index 4bc0011..017312b 100644
--- a/database/migrations/2018_10_19_114521_create_draft_items_table.php
+++ b/database/migrations/2018_10_19_114521_create_draft_items_table.php
@@ -42,6 +42,7 @@ class CreateDraftItemsTable extends Migration
$table->foreign('draft_type_id')
->references('id')
->on('draft_types');
+
});
}
diff --git a/database/migrations/2021_07_22_121942_create_travel_places_table.php b/database/migrations/2021_07_22_121942_create_travel_places_table.php
new file mode 100644
index 0000000..1b4ce73
--- /dev/null
+++ b/database/migrations/2021_07_22_121942_create_travel_places_table.php
@@ -0,0 +1,45 @@
+create('travel_places', function (Blueprint $table) {
+ $table->increments('id');
+
+ $table->string('name')->nullable();
+ $table->text('description')->nullable();
+
+ $table->integer('travel_country_id')->nullable();
+ $table->decimal('latitude', 10, 6)->nullable();
+ $table->decimal('longitude', 10, 6)->nullable();
+
+ $table->boolean('active')->default(true);
+
+ $table->timestamps();
+
+ $table->foreign('travel_country_id')
+ ->references('id')
+ ->on('travel_country');
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::connection('mysql_stern')->dropIfExists('travel_places');
+ }
+}
\ No newline at end of file
diff --git a/database/migrations/2021_08_03_160933_create_i_q_travel_blocks_table.php b/database/migrations/2021_08_03_160933_create_i_q_travel_blocks_table.php
new file mode 100644
index 0000000..af0fa65
--- /dev/null
+++ b/database/migrations/2021_08_03_160933_create_i_q_travel_blocks_table.php
@@ -0,0 +1,65 @@
+create('i_q_travel_blocks', function (Blueprint $table) {
+ $table->increments('id');
+
+ $table->string('name')->nullable();
+ $table->text('description')->nullable();
+ $table->text('highlights')->nullable();
+
+
+ $table->unsignedInteger('draft_type_id')->nullable()->index();
+ $table->unsignedInteger('travel_place_id')->nullable()->index();
+ $table->integer('travel_country_id')->nullable();
+
+
+ $table->tinyInteger('days_start')->unsigned()->nullable();
+ $table->tinyInteger('days_duration')->unsigned()->nullable();
+
+ $table->tinyInteger('min_persons')->unsigned()->nullable();
+
+ $table->decimal('price_adult', 8, 2)->nullable();
+ $table->decimal('price_children', 8, 2)->nullable();
+
+ $table->tinyInteger('pos')->unsigned()->nullable();
+ $table->boolean('active')->default(true);
+
+ $table->timestamps();
+
+ $table->foreign('draft_type_id')
+ ->references('id')
+ ->on('draft_types');
+
+ $table->foreign('travel_place_id')
+ ->references('id')
+ ->on('travel_places');
+
+ $table->foreign('travel_country_id')
+ ->references('id')
+ ->on('travel_country');
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::connection('mysql_stern')->dropIfExists('i_q_travel_blocks');
+ }
+}
diff --git a/database/migrations/2021_08_03_160933_create_i_q_travel_items_table.php b/database/migrations/2021_08_03_160933_create_i_q_travel_items_table.php
new file mode 100644
index 0000000..41c4f34
--- /dev/null
+++ b/database/migrations/2021_08_03_160933_create_i_q_travel_items_table.php
@@ -0,0 +1,58 @@
+create('i_q_travel_items', function (Blueprint $table) {
+ $table->increments('id');
+
+ $table->string('name')->nullable();
+ $table->text('description')->nullable();
+ $table->text('highlights')->nullable();
+
+ $table->unsignedInteger('draft_type_id')->nullable()->index();
+ $table->integer('travel_country_id')->nullable();
+
+ $table->tinyInteger('days_start')->unsigned()->nullable();
+ $table->tinyInteger('days_duration')->unsigned()->nullable();
+
+ $table->tinyInteger('min_persons')->unsigned()->nullable();
+
+ $table->decimal('price_adult', 8, 2)->nullable();
+ $table->decimal('price_children', 8, 2)->nullable();
+
+ $table->tinyInteger('pos')->unsigned()->nullable();
+ $table->boolean('active')->default(true);
+
+ $table->timestamps();
+
+ /*$table->foreign('draft_type_id')
+ ->references('id')
+ ->on('draft_types');*/
+
+ $table->foreign('travel_country_id')
+ ->references('id')
+ ->on('travel_country');
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::connection('mysql_stern')->dropIfExists('i_q_travel_items');
+ }
+}
diff --git a/database/migrations/2021_08_03_162513_create_i_q_travel_item_places_table.php b/database/migrations/2021_08_03_162513_create_i_q_travel_item_places_table.php
new file mode 100644
index 0000000..952ae34
--- /dev/null
+++ b/database/migrations/2021_08_03_162513_create_i_q_travel_item_places_table.php
@@ -0,0 +1,49 @@
+create('i_q_travel_item_places', function (Blueprint $table) {
+
+ $table->bigIncrements('id');
+
+ $table->unsignedInteger('i_q_travel_item_id')->index();
+ $table->unsignedInteger('travel_place_id')->index();
+ $table->tinyInteger('pos')->unsigned()->nullable();
+
+
+ $table->timestamps();
+
+ $table->foreign('i_q_travel_item_id')
+ ->references('id')
+ ->on('i_q_travel_items')
+ ->onDelete('cascade');
+
+ $table->foreign('travel_place_id')
+ ->references('id')
+ ->on('travel_places')
+ ->onDelete('cascade');
+
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::connection('mysql_stern')->dropIfExists('i_q_travel_item_places');
+ }
+}
diff --git a/database/migrations/2021_08_03_162759_create_i_q_travel_groups_table.php b/database/migrations/2021_08_03_162759_create_i_q_travel_groups_table.php
new file mode 100644
index 0000000..e853912
--- /dev/null
+++ b/database/migrations/2021_08_03_162759_create_i_q_travel_groups_table.php
@@ -0,0 +1,48 @@
+create('i_q_travel_groups', function (Blueprint $table) {
+
+ $table->increments('id');
+
+ $table->string('name')->nullable();
+ $table->text('description')->nullable();
+ $table->text('highlights')->nullable();
+
+ $table->tinyInteger('days_start')->unsigned()->nullable();
+ $table->tinyInteger('days_duration')->unsigned()->nullable();
+
+ $table->tinyInteger('min_persons')->unsigned()->nullable();
+
+ $table->decimal('price_adult', 8, 2)->nullable();
+ $table->decimal('price_children', 8, 2)->nullable();
+
+ $table->tinyInteger('pos')->unsigned()->nullable();
+ $table->boolean('active')->default(true);
+
+ $table->timestamps();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::connection('mysql_stern')->dropIfExists('i_q_travel_groups');
+ }
+}
diff --git a/database/migrations/2021_08_03_163156_create_i_q_travel_group_items_table.php b/database/migrations/2021_08_03_163156_create_i_q_travel_group_items_table.php
new file mode 100644
index 0000000..bb2d79e
--- /dev/null
+++ b/database/migrations/2021_08_03_163156_create_i_q_travel_group_items_table.php
@@ -0,0 +1,47 @@
+create('i_q_travel_group_items', function (Blueprint $table) {
+ $table->bigIncrements('id');
+
+ $table->unsignedInteger('i_q_travel_group_id')->index();
+ $table->unsignedInteger('i_q_travel_item_id')->index();
+ $table->tinyInteger('pos')->unsigned()->nullable();
+
+
+ $table->timestamps();
+
+ $table->foreign('i_q_travel_group_id')
+ ->references('id')
+ ->on('i_q_travel_groups')
+ ->onDelete('cascade');
+
+ $table->foreign('i_q_travel_item_id')
+ ->references('id')
+ ->on('i_q_travel_items')
+ ->onDelete('cascade');
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::connection('mysql_stern')->dropIfExists('i_q_travel_group_items');
+ }
+}
diff --git a/resources/views/admin/modal/iq_travel_group-item.blade.php b/resources/views/admin/modal/iq_travel_group-item.blade.php
new file mode 100644
index 0000000..964efea
--- /dev/null
+++ b/resources/views/admin/modal/iq_travel_group-item.blade.php
@@ -0,0 +1,37 @@
+
Der Gruppenbaustein muss erst mit einem Name gespeichert werden.
+ @endif +| + | {{__('Name')}} | +{{__('Bausteine')}} | +{{__('sichbar')}} | ++ |
|---|
Der Baustein muss erst mit einem Name gespeichert werden.
+ @endif +| + | {{__('Name')}} | +{{__('Typ')}} | +{{__('Land')}} | +{{__('Ort(e)')}} | +{{__('sichbar')}} | ++ + |
|---|
| + | {{__('Name')}} | +{{__('')}} | +{{__('sichbar')}} | ++ |
|---|