Exemple #1
0
 /**
  * Return the shares of the Participation related to this event
  *
  * @return float share
  */
 public function getParticipationShare()
 {
     $shares = 0;
     $wish = $this->getUid();
     if ($this->getShares() > 0) {
         $participation = Tx_Nboevents_Utility_Cookies::getCookieValue('Participation' . $wish);
         if ($participation) {
             $repo = t3lib_div::makeInstance('Tx_Nbowishlist_Domain_Repository_ParticipationRepository');
             $shares = $repo->sharesByParticipationAndWish($participation, $wish);
         }
     }
     return $shares;
 }
 /**
  * action new
  *
  * @param $wish
  *
  * @dontverifyrequesthash
  * @return void
  */
 public function newAction(Tx_Nbowishlist_Domain_Model_Wish $wish)
 {
     $newParticipation = $this->request->hasArgument('newParticipation') ? $this->request->getArgument('newParticipation') : NULL;
     $newPerson = $this->request->hasArgument('newPerson') ? $this->request->getArgument('newPerson') : NULL;
     if (!isset($newPerson)) {
         $uid = Tx_Nboevents_Utility_Cookies::getCookieValue('Participation' . $wish->getUid());
         if ($this->participationRepository->countByUid($uid) > 0) {
             $newParticipation = $uid;
             $person = $this->participationRepository->personByUid($newParticipation);
             if ($this->personRepository->countByUid($person)) {
                 $this->redirect('edit', NULL, NULL, array('newParticipation' => $newParticipation, 'newPerson' => $person, 'wish' => $wish));
             }
         }
         $pid = Tx_Nboevents_Utility_Cookies::getCookieValue('Person');
         $newPerson = $this->personRepository->findByUid($pid);
     }
     $this->view->assign('e', $e);
     $this->view->assign('wish', $wish);
     $this->view->assign('newPerson', $newPerson);
     $this->view->assign('newParticipation', $newParticipation);
 }
Exemple #3
0
 /**
  * Event has Reservation
  *
  * @return boolean
  */
 public function getHasReservation()
 {
     $result = Tx_Nboevents_Utility_Cookies::getCookieValue('Reservation' . $this->getUid());
     $has = false;
     if ($result > 0) {
         $reservationRepository = t3lib_div::makeInstance('Tx_Nboevents_Domain_Repository_ReservationRepository');
         if ($reservationRepository->countByUid($result)) {
             $has = true;
         }
     }
     return $has;
 }
 /**
  * action new
  *
  * @dontverifyrequesthash
  * @return void
  */
 public function newAction(Tx_Nboevents_Domain_Model_Event $event)
 {
     //$event = $this->request->hasArgument('event') ? $this->request->getArgument('event') : NULL;
     $newReservation = $this->request->hasArgument('newReservation') ? $this->request->getArgument('newReservation') : NULL;
     $newPerson = $this->request->hasArgument('newPerson') ? $this->request->getArgument('newPerson') : NULL;
     $e = $this->request->hasArgument('e') ? $this->request->getArgument('e') : '';
     if (!isset($newPerson)) {
         $uid = Tx_Nboevents_Utility_Cookies::getCookieValue('Reservation' . $event->getUid());
         if ($this->reservationRepository->countByUid($uid)) {
             $newReservation = $uid;
             $person = $this->reservationRepository->getPersonUid($newReservation);
             if ($this->personRepository->countByUid($person)) {
                 $this->redirect('edit', NULL, NULL, array('newReservation' => $newReservation, 'newPerson' => $person, 'event' => $event));
             }
         }
         $pid = Tx_Nboevents_Utility_Cookies::getCookieValue('Person');
         $newPerson = $this->personRepository->findByUid($pid);
     }
     $this->view->assign('e', $e);
     $this->view->assign('event', $event);
     $this->view->assign('newPerson', $newPerson);
     $this->view->assign('newReservation', $newReservation);
 }