public function getFields()
 {
     if (!class_exists('Payment')) {
         throw new Exception('Please install the Payment module to accept event payments.');
     }
     $datetime = $this->getForm()->getController()->getDateTime();
     $session = $this->getForm()->getSession();
     $tickets = $this->getForm()->getSavedStepByClass('EventRegisterTicketsStep');
     $total = $tickets->getTotal();
     $table = new EventRegistrationTicketsTableField('Tickets', $datetime);
     $table->setReadonly(true);
     $table->setExcludedRegistrationId($session->RegistrationID);
     $table->setShowUnavailableTickets(false);
     $table->setShowUnselectedTickets(false);
     $table->setTotal($total);
     // the following 2 methods are not in the updated payment module
     // so ignore them as we will be handling this in the extension anyway
     //Requirements::customScript(Payment::combined_form_requirements());
     // add the payment field via the extension
     //$payment = Payment::combined_form_fields($total->Nice());
     // we will replace this field in the extension
     $fields = new FieldList(new LiteralField('ConfirmTicketsNote', '<p>Please confirm the tickets you wish to purchase:</p>'), $table);
     $this->extend('updateFields', $fields);
     return $fields;
 }
 public function getFields()
 {
     $datetime = $this->getForm()->getController()->getDateTime();
     $session = $this->getForm()->getSession();
     $fields = new FieldList($tickets = new EventRegistrationTicketsTableField('Tickets', $datetime));
     $tickets->setExcludedRegistrationId($session->RegistrationID);
     $fields->push(new TextField('Name', 'Your name '));
     $fields->push(new EmailField('Email', 'Email address'));
     $this->extend('updateFields', $fields);
     return $fields;
 }
 public function getFields()
 {
     $datetime = $this->getForm()->getController()->getDateTime();
     $session = $this->getForm()->getSession();
     $fields = new FieldSet($tickets = new EventRegistrationTicketsTableField('Tickets', $datetime));
     $tickets->setExcludedRegistrationId($session->RegistrationID);
     if ($member = Member::currentUser()) {
         $fields->push(new ReadonlyField('Name', 'Your name', $member->getName()));
         $fields->push(new ReadonlyField('Email', 'Email address', $member->Email));
     } else {
         $fields->push(new TextField('Name', 'Your name'));
         $fields->push(new EmailField('Email', 'Email address'));
     }
     $this->extend('updateFields', $fields);
     return $fields;
 }
 public function getFields()
 {
     $datetime = $this->getForm()->getController()->getDateTime();
     $session = $this->getForm()->getSession();
     $tickets = $this->getForm()->getSavedStepByClass('EventRegisterTicketsStep');
     $total = $tickets->getTotal();
     $table = new EventRegistrationTicketsTableField('Tickets', $datetime);
     $table->setReadonly(true);
     $table->setExcludedRegistrationId($session->RegistrationID);
     $table->setShowUnavailableTickets(false);
     $table->setShowUnselectedTickets(false);
     $table->setForceTotalRow(true);
     $table->setTotal($total);
     $fields = new FieldList(new LiteralField('ConfirmTicketsNote', '<p>Please confirm the tickets you wish to register for:</p>'), $table);
     $this->extend('updateFields', $fields);
     return $fields;
 }
 public function getFields()
 {
     if (!class_exists('Payment')) {
         throw new Exception('Please install the Payment module to accept event payments.');
     }
     $datetime = $this->getForm()->getController()->getDateTime();
     $session = $this->getForm()->getSession();
     $tickets = $this->getForm()->getSavedStepByClass('EventRegisterTicketsStep');
     $total = $tickets->getTotal();
     $table = new EventRegistrationTicketsTableField('Tickets', $datetime);
     $table->setReadonly(true);
     $table->setExcludedRegistrationId($session->RegistrationID);
     $table->setShowUnavailableTickets(false);
     $table->setShowUnselectedTickets(false);
     $table->setTotal($total);
     Requirements::customScript(Payment::combined_form_requirements());
     $payment = Payment::combined_form_fields($total->Nice());
     $fields = new FieldSet(new LiteralField('ConfirmTicketsNote', '<p>Please confirm the tickets you wish to purchase:</p>'), $table, new FieldGroup($payment));
     $this->extend('updateFields', $fields);
     return $fields;
 }