IQ Reisebausteine bis Gruppe

This commit is contained in:
Kevin Adametz 2021-08-06 15:28:57 +02:00
parent 6880c7e989
commit 9baa1a6233
43 changed files with 2206 additions and 24 deletions

View file

@ -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 .= '<option value="'.$option->crm_id.'" '.$attr.'>'.$option->name.'</option>\n';
$id = $crm ? $option->crm_id : $option->id;
$attr = (in_array($id, $checked)) ? 'selected="selected"' : '';
$ret .= '<option value="'.$id.'" '.$attr.'>'.$option->name.'</option>\n';
}
return $ret;
}
public static function getTravelUserOptions($id = false, $order = "ASC", $empty=false){
$options = TravelUser::orderBy('id', $order)->get();
$ret = '';
if($empty){
$ret = '<option value="">Bitte wählen</option>\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 = '<option value="">Bitte wählen</option>\n';
}
foreach ($options as $option){
$attr = ($option->id === $id) ? 'selected="selected"' : '';
$ret .= '<option value="'.$option->id.'" '.$attr.'>'.$option->name.'</option>\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 = '<option value="">Bitte wählen</option>\n';
}
foreach ($options as $option){
$attr = ($option->id === $id) ? 'selected="selected"' : '';
$ret .= '<option value="'.$option->id.'" '.$attr.'>'.$option->name.'</option>\n';
}
return $ret;
}
public static function getCustomerMailDirsOptions(CMSContent $customer_mail_dir, $checked = []){
//$checked = [];
$model = $customer_mail_dir->getArrayContent('model');