public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $this->options = $options;
     $this->institution = $builder->getData();
     $status = InstitutionStatus::getBitValueLabels();
     if (!$this->institution instanceof Institution) {
         throw InstitutionFormException::nonInstitutionFormData(__CLASS__, $this->institution);
     }
     $this->_add($builder, 'name', 'text');
     $this->_add($builder, 'status', 'choice', array('label' => 'Status', 'choices' => $status));
     $this->_add($builder, 'description', 'textarea', array('required' => false));
     $this->_add($builder, 'medicalProviderGroups', 'collection', array('type' => 'medicalProviderGroup_list', 'allow_add' => true, 'allow_delete' => true, 'options' => array('required' => false)));
     $this->_add($builder, 'country', FancyCountryFieldType::NAME, array('label' => 'Country', 'error_bubbling' => false));
     $this->_add($builder, 'city', GlobalCityListType::NAME, array('label' => 'City', 'error_bubbling' => false));
     $this->_add($builder, 'zipCode', 'text', array('label' => 'Zip / Postal Code'));
     $this->_add($builder, 'state', 'state_list', array('label' => 'State / Province'));
     $this->_add($builder, 'contactEmail', 'text', array('label' => 'Email Address ', 'required' => false));
     $this->_add($builder, 'address1', 'detailed_street_address', array('label' => 'Hospital Address'));
     $this->_add($builder, 'addressHint', 'text', array('label' => 'Helpful hint for getting there?', 'required' => false));
     $this->_add($builder, 'contactDetails', 'collection', array('type' => 'simple_contact_detail'));
     $this->_add($builder, 'websites', 'website_custom_field', array('label' => 'Website', 'required' => false));
     $this->_add($builder, 'socialMediaSites', 'social_media_sites_custom_field');
     $this->_add($builder, 'logo', new InstitutionMediaFileType($this->institution->getLogo()));
     $this->_add($builder, 'featuredMedia', new InstitutionMediaFileType($this->institution->getFeaturedMedia()));
     $this->_add($builder, 'coordinates', 'hidden');
     $this->_add($builder, 'type', 'choice', array('label' => 'Institution Type', 'empty_value' => false, 'multiple' => false, 'choices' => InstitutionTypes::getFormChoices()));
 }
 function setFilterOptions()
 {
     $statusOptions = array(ListFilter::FILTER_KEY_ALL => ListFilter::FILTER_LABEL_ALL) + InstitutionStatus::getBitValueLabels();
     $this->setNameFilterOption();
     $this->setPayingClientOption();
     $this->setCountryFilterOption();
     $this->setTypeFilterOption();
     $this->setStatusFilterOption($statusOptions);
 }
 /**
  * @PreAuthorize("hasAnyRole('SUPER_ADMIN', 'CAN_VIEW_INSTITUTIONS')")
  */
 public function viewNewlyRegisteredAction()
 {
     $criteria = array('isFromInternalAdmin' => null, 'status' => InstitutionStatus::INACTIVE);
     $institutions = $this->getDoctrine()->getRepository('InstitutionBundle:Institution')->findBy($criteria);
     $params = array('institutions' => $institutions, 'statusList' => InstitutionStatus::getBitValueLabels());
     return $this->render('AdminBundle:Institution:newlyRegistered.html.twig', $params);
 }