* Suchergebnisse zu Reiseprogrammen verlinken
git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3286 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
parent
23b2c7a7e8
commit
56d6e88451
6 changed files with 78 additions and 5 deletions
|
|
@ -97,7 +97,10 @@
|
|||
alt="Verfügbarkeit">
|
||||
</td>
|
||||
|
||||
<td data-title=""><a href="" class="btn btn-primary">buchen</a></td>
|
||||
<td data-title="">
|
||||
{# #TODO Bad performance #}
|
||||
<a href="{{ travel_program.page.urlPath }}" class="btn btn-primary">Details</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@
|
|||
<a href="{{ page.urlPath ~ '/buchen?nr=' ~ travel_date.name }}"
|
||||
class="btn btn-primary"
|
||||
>
|
||||
buchen
|
||||
Buchungsformular
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class DefaultController extends Controller
|
|||
$stopwatch = $this->get('debug.stopwatch');
|
||||
$em = $this->getEntityManager();
|
||||
|
||||
$destinationsIds = [6,7];
|
||||
$destinationIds = null;
|
||||
$destination = $em->getRepository('AppBundle:TravelCountry')->find($request->query->get('c'));
|
||||
if ($destination)
|
||||
{
|
||||
|
|
@ -106,7 +106,7 @@ class DefaultController extends Controller
|
|||
|
||||
$stopwatch->start('search');
|
||||
$r = $this->getDoctrine()->getRepository('AppBundle:TravelPeriod')->getTravelProgramsWithTravelDatesForTimePeriod(
|
||||
$startDate, $endDate, $destinationsIds, true);
|
||||
$startDate, $endDate, $destinationIds, true);
|
||||
$stopwatch->stop('search');
|
||||
|
||||
return $this->render('default/pages/search.html.twig', [
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class Page
|
|||
/**
|
||||
* @var TravelProgram
|
||||
*
|
||||
* @ORM\OneToOne(targetEntity="AppBundle\Entity\TravelProgram")
|
||||
* @ORM\OneToOne(targetEntity="AppBundle\Entity\TravelProgram", inversedBy="page")
|
||||
* @ORM\JoinColumn(name="travel_program", referencedColumnName="id")
|
||||
*/
|
||||
private $travelProgram;
|
||||
|
|
|
|||
|
|
@ -133,4 +133,45 @@ class TravelCountry
|
|||
{
|
||||
return $this->feedbackPage;
|
||||
}
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->programs = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add program
|
||||
*
|
||||
* @param \AppBundle\Entity\TravelProgram $program
|
||||
*
|
||||
* @return TravelCountry
|
||||
*/
|
||||
public function addProgram(\AppBundle\Entity\TravelProgram $program)
|
||||
{
|
||||
$this->programs[] = $program;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove program
|
||||
*
|
||||
* @param \AppBundle\Entity\TravelProgram $program
|
||||
*/
|
||||
public function removeProgram(\AppBundle\Entity\TravelProgram $program)
|
||||
{
|
||||
$this->programs->removeElement($program);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get programs
|
||||
*
|
||||
* @return \Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getPrograms()
|
||||
{
|
||||
return $this->programs;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -331,6 +331,11 @@ class TravelProgram
|
|||
*/
|
||||
private $options;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="AppBundle\Entity\Page", mappedBy="travelProgram")
|
||||
*/
|
||||
private $page;
|
||||
|
||||
/**
|
||||
* @var array|TravelDate[]
|
||||
*/
|
||||
|
|
@ -1513,4 +1518,28 @@ class TravelProgram
|
|||
}
|
||||
return $this->getImages()[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set page
|
||||
*
|
||||
* @param \AppBundle\Entity\Page $page
|
||||
*
|
||||
* @return TravelProgram
|
||||
*/
|
||||
public function setPage(\AppBundle\Entity\Page $page = null)
|
||||
{
|
||||
$this->page = $page;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get page
|
||||
*
|
||||
* @return \AppBundle\Entity\Page
|
||||
*/
|
||||
public function getPage()
|
||||
{
|
||||
return $this->page;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue