/**
  * Creates the form that lets a speaker review his details. Merges
  * several forms together.
  *
  * @return  Form
  */
 public function ReviewForm()
 {
     if (!$this->isMe()) {
         return $this->httpError(403);
     }
     $fields = FieldList::create(HeaderField::create('Your details'));
     $dummy = SpeakerForm::create($this, "EditSpeakerForm", FieldList::create());
     $fields->merge($dummy->Fields());
     $fields->bootstrapIgnore('Photo');
     /*if(!$this->speaker->Member()->getSummitState('VIDEO_AGREEMENT_SEEN')) {
           $fields->push(HeaderField::create('Do you agree to be video recorded?'));
           $fields->push(LiteralField::create('legal', $this->parent->getParent()->LegalAgreement));
           $fields->merge($this->LegalForm()->Fields());
       }*/
     if (!$this->speaker->Member()->getSummitState('BUREAU_SEEN')) {
         $fields->push(HeaderField::create('Want to be in the Speakers\' Bureau?'));
         $fields->merge($this->BureauForm()->Fields());
     }
     $form = BootstrapForm::create($this, "ReviewForm", $fields, FieldList::create(FormAction::create('doReviewForm', 'Save my details')), $dummy->getSpeakerValidator());
     if ($data = Session::get("FormInfo.{$form->FormName()}.data")) {
         return $form->loadDataFrom($data);
     }
     return $form->loadDataFrom($this->speaker);
 }
Exemplo n.º 2
0
 /**
  * Creates the form that lets a speaker review his details. Merges
  * several forms together.
  * @return  Form
  */
 public function ReviewForm()
 {
     if (!$this->isMe()) {
         return $this->httpError(403);
     }
     $fields = FieldList::create(HeaderField::create('Your details'));
     $dummy = SpeakerForm::create($this, "EditSpeakerForm", FieldList::create());
     $fields->merge($dummy->Fields());
     $fields->bootstrapIgnore('Photo');
     $form = BootstrapForm::create($this, "ReviewForm", $fields, FieldList::create(FormAction::create('doReviewForm', 'Save my details')), $dummy->getSpeakerValidator());
     if ($data = Session::get("FormInfo.{$form->FormName()}.data")) {
         return $form->loadDataFrom($data);
     }
     return $form->loadDataFrom($this->speaker);
 }