Compare commits

...
Sign in to create a new pull request.

3 commits

Author SHA1 Message Date
Kevin Adametz
d64ee56813 On master: Tower Auto-Stash: 2018-10-15 16:57:13 +0200 2018-10-15 16:57:14 +02:00
Kevin Adametz
a973295e85 index on master: 6a77aca Anpassung ID zum v2 backend 2018-10-15 16:57:13 +02:00
Kevin Adametz
6a77acad86 Anpassung ID zum v2 backend 2018-10-15 16:56:33 +02:00
5 changed files with 35 additions and 9 deletions

View file

@ -663,7 +663,7 @@
</div> <!-- st trav -->
<h2>Hinweis</h2>
<p>Sofern Sie nicht oder nicht ausschließlich nur die deutsche Staatsbürgerschaft besitzen, können Sie die Reise nicht buchen,
<p>Sofern Sie nicht oder nicht ausschließlich nur die deutsche, österreichische oder schweizerische Staatsbürgerschaft besitzen, können Sie die Reise nicht buchen,
da wir Sie vorher u.a. über die Einreisebestimmungen für Ihre individuelle Staatsbürgerschaft informieren müssen.
Bitte nehmen Sie vor einer Buchung Kontakt mit uns auf, damit Sie nach Erhalt der Informationen entscheiden können, ob Sie die Reise buchen möchten.</p>
</div> <!-- col -->

View file

@ -101,6 +101,8 @@ class BookingController extends Controller
'travel_date' => $travelDate,
'travel_program' => $travelProgram
]);
die();
if ($request->getMethod() == 'POST')
{
$form->handleRequest($request);

View file

@ -371,6 +371,7 @@ class TravelPeriodRepository extends \Doctrine\ORM\EntityRepository
\DateTime $startDate = null, \DateTime $endDate = null)
{
$currencyFactor = $travelProgram->getNettoPricesInEuro() ? 1 : $this->getCurrencyFactor();
$counters = array();
// #TODO Consider adding travelPeriods to travelProgram in the search algorithm
//foreach ($travelProgram->getPeriods() as $travelPeriod)
@ -378,9 +379,13 @@ class TravelPeriodRepository extends \Doctrine\ORM\EntityRepository
{
if ($travelPeriod->getIsSeason())
{
$i = 1;
foreach ($travelPeriod->getDates() as $travelPeriodDate)
{
$cn = $travelPeriodDate->getId().$travelPeriod->getName();
if(empty($counters[$cn])){
$counters[$cn] = 1;
}
$seasonEndDate = clone $travelPeriodDate->getEndDate();
$seasonEndDate->modify('+'.$travelProgram->getProgramDuration().' day');
if ($endDate != null && $seasonEndDate > $endDate)
@ -413,6 +418,7 @@ class TravelPeriodRepository extends \Doctrine\ORM\EntityRepository
// #TODO Do we need the travel date key?
$travelDateEnd = (clone $date)->modify('+'.$travelProgram->getProgramDuration().' day');
$travelDateKey = $this->createTravelDateKey($date, $travelDateEnd);
if (!$travelProgram->hasTravelDate($travelDateKey))
{
$flightPeriod = null;
@ -425,7 +431,7 @@ class TravelPeriodRepository extends \Doctrine\ORM\EntityRepository
$travelProgram->addTravelDateFromSeasonTravelPeriod(
$travelDateKey,
$travelPeriod,
$travelPeriodDate->getId() . $travelPeriod->getName() . $i,
$travelPeriodDate->getId() . $travelPeriod->getName() . $counters[$cn],
$date,
$travelDateEnd,
$flightPeriod,
@ -437,7 +443,7 @@ class TravelPeriodRepository extends \Doctrine\ORM\EntityRepository
// Also increment $i if the date is theoretically possible but excluded from the search request
if ($isPossibleDate)
{
++$i;
++ $counters[$cn];
}
}
}

View file

@ -1631,7 +1631,6 @@ class TravelProgram
public function addTravelDateFromSeasonTravelPeriod($key, TravelPeriod $travelPeriod, $index, \DateTime $start,
\DateTime $end = null, FlightPeriod $flightPeriod = null, $currencyFactor)
{
$this->assertTravelDateNotDefinedYet($key);
$this->isTravelDateMapTainted = true;
$this->travelDateByKey[$key] = TravelDate::createForSeasonTravelPeriod($key, $travelPeriod, $index, $start,

View file

@ -7,6 +7,7 @@
namespace AppBundle\Form;
use AppBundle\Entity\Traveler;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
@ -34,6 +35,8 @@ class TravelerType extends AbstractType
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setAllowedTypes('nationality', ['AppBundle\Entity\TravelNationality']);
$resolver->setDefaults(array(
'data_class' => 'AppBundle\Entity\Traveler'
));
@ -45,6 +48,10 @@ class TravelerType extends AbstractType
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$nationality = $options['nationality'];
$builder
->add('sex', ChoiceType::class, [
//'placeholder' => 'Geschlecht (Bitte wählen) *',
@ -57,23 +64,35 @@ class TravelerType extends AbstractType
->add('firstName')
->add('lastName')
->add('birthDate')
->add('nationality', ChoiceType::class, [
/*->add('nationality', ChoiceType::class, [
'choices' => self::$NATIONALITY_CHOICES,
'constraints' => [
new NotNull(),
new Choice(['choices' => self::$NATIONALITY_CHOICES])
],
'required' => true,
])
])*/
->add('acceptEntryRequirements', CheckboxType::class, ['required' => true])
;
/*
, StDateType::class, [
'format' => 'dd.MM.yyyy'
]
*/
$builder->add('nationality', EntityType::class, [
'placeholder' => 'Nationalität (Bitte wählen) *',
'class' => 'AppBundle\Entity\TravelNationality',
'choices' => $nationality->getNationality(),
'constraints' => [
new NotNull(),
new Choice([
'choices' => $nationality->getNationality()
]
)]
]);
}
}