* Fertigstellung Buchungsformular (#1321) (SternTours-CRM-API-Anbindung, Mailversand, Validierung, Dynamische Preisberechnung, Persistierung von Buchungsinformationen)
* Fehler bei der Preisberechnung behoben * Farbschema geändert (Kevin Adametz) git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3289 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
parent
dde3b91724
commit
3a28866cd2
36 changed files with 2200 additions and 268 deletions
|
|
@ -8,7 +8,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||
* TravelBooking
|
||||
*
|
||||
* @ORM\Table(name="travel_booking", indexes={@ORM\Index(name="FK_travel_booking_travel_period", columns={"period_id"}), @ORM\Index(name="FK_travel_booking_travel_program", columns={"program_id"})})
|
||||
* @ORM\Entity
|
||||
* @ORM\Entity(repositoryClass="AppBundle\Entity\TravelBookingRepository")
|
||||
*/
|
||||
class TravelBooking
|
||||
{
|
||||
|
|
@ -678,7 +678,7 @@ class TravelBooking
|
|||
*/
|
||||
public function setSelectedDeparture($selectedDeparture)
|
||||
{
|
||||
$this->selectedDeparture = $selectedDeparture;
|
||||
$this->selectedDeparture = is_array($selectedDeparture) ? json_encode($selectedDeparture) : $selectedDeparture;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -690,7 +690,12 @@ class TravelBooking
|
|||
*/
|
||||
public function getSelectedDeparture()
|
||||
{
|
||||
return $this->selectedDeparture;
|
||||
$ret = json_decode($this->selectedDeparture, true);
|
||||
if (empty($ret) || !is_array($ret))
|
||||
{
|
||||
return $this->selectedDeparture;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -846,7 +851,7 @@ class TravelBooking
|
|||
*/
|
||||
public function setRooms($rooms)
|
||||
{
|
||||
$this->rooms = $rooms;
|
||||
$this->options = is_array($rooms) ? json_encode($rooms) : $rooms;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -858,19 +863,43 @@ class TravelBooking
|
|||
*/
|
||||
public function getRooms()
|
||||
{
|
||||
return $this->rooms;
|
||||
$ret = json_decode($this->rooms, true);
|
||||
if (empty($ret) || !is_array($ret))
|
||||
{
|
||||
return $this->rooms;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set participants
|
||||
*
|
||||
* @param string $participants
|
||||
* @param Traveler[] $travelers
|
||||
*
|
||||
* @return TravelBooking
|
||||
*/
|
||||
public function setParticipants($participants)
|
||||
public function setParticipants($travelers)
|
||||
{
|
||||
$this->participants = $participants;
|
||||
if (!is_array($travelers))
|
||||
{
|
||||
$this->participants = $travelers;
|
||||
return $this;
|
||||
}
|
||||
|
||||
$participants = [];
|
||||
|
||||
for ($i = 0; $i < count($travelers); ++$i)
|
||||
{
|
||||
$traveler = $travelers[$i];
|
||||
$participants[''. ($i+1)] = [
|
||||
'gender' => $traveler->getSex(),
|
||||
'first_name' => $traveler->getFirstName(),
|
||||
'last_name' => $traveler->getLastName(),
|
||||
'birthday' => $traveler->getBirthDate()->format('d.m.Y')
|
||||
];
|
||||
}
|
||||
|
||||
$this->participants = json_encode($participants);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -882,7 +911,22 @@ class TravelBooking
|
|||
*/
|
||||
public function getParticipants()
|
||||
{
|
||||
return $this->participants;
|
||||
$participants = json_decode($this->participants, true);
|
||||
if (empty($participants) || !is_array($participants))
|
||||
{
|
||||
return $this->participants;
|
||||
}
|
||||
$ret = [];
|
||||
foreach ($participants as $participant)
|
||||
{
|
||||
$traveler = new Traveler();
|
||||
$traveler->setSex(intval($participant['gender']));
|
||||
$traveler->setFirstName($participant['first_name']);
|
||||
$traveler->setLastName($participant['last_name']);
|
||||
$traveler->setBirthDate(\DateTime::createFromFormat('d.m.Y', $participant['birthday']));
|
||||
$ret[] = $traveler;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -990,7 +1034,7 @@ class TravelBooking
|
|||
*/
|
||||
public function setInsurances($insurances)
|
||||
{
|
||||
$this->insurances = $insurances;
|
||||
$this->insurances = is_array($insurances) ? json_encode($insurances) : $insurances;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -1002,7 +1046,12 @@ class TravelBooking
|
|||
*/
|
||||
public function getInsurances()
|
||||
{
|
||||
return $this->insurances;
|
||||
$ret = json_decode($this->insurances, true);
|
||||
if (empty($ret) || !is_array($ret))
|
||||
{
|
||||
return $this->insurances;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1014,7 +1063,7 @@ class TravelBooking
|
|||
*/
|
||||
public function setOptions($options)
|
||||
{
|
||||
$this->options = $options;
|
||||
$this->options = is_array($options) ? json_encode($options) : $options;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -1026,7 +1075,12 @@ class TravelBooking
|
|||
*/
|
||||
public function getOptions()
|
||||
{
|
||||
return $this->options;
|
||||
$ret = json_decode($this->options, true);
|
||||
if (empty($ret) || !is_array($ret))
|
||||
{
|
||||
return $this->options;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1038,7 +1092,7 @@ class TravelBooking
|
|||
*/
|
||||
public function setClassOptions($classOptions)
|
||||
{
|
||||
$this->classOptions = $classOptions;
|
||||
$this->classOptions = is_array($classOptions) ? json_encode($classOptions) : $classOptions;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -1050,7 +1104,12 @@ class TravelBooking
|
|||
*/
|
||||
public function getClassOptions()
|
||||
{
|
||||
return $this->classOptions;
|
||||
$ret = json_decode($this->classOptions, true);
|
||||
if (empty($ret) || !is_array($ret))
|
||||
{
|
||||
return $this->classOptions;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1062,7 +1121,7 @@ class TravelBooking
|
|||
*/
|
||||
public function setExtraCategory($extraCategory)
|
||||
{
|
||||
$this->extraCategory = $extraCategory;
|
||||
$this->extraCategory = is_array($extraCategory) ? json_encode($extraCategory) : $extraCategory;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -1074,7 +1133,12 @@ class TravelBooking
|
|||
*/
|
||||
public function getExtraCategory()
|
||||
{
|
||||
return $this->extraCategory;
|
||||
$ret = json_decode($this->extraCategory, true);
|
||||
if (empty($ret) || !is_array($ret))
|
||||
{
|
||||
return $this->extraCategory;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue