add('submit', SubmitType::class, array( "label" => ($options["mode"]=="delete"?"Confirmer la Suppression":"Valider"), "attr" => ($options["mode"]=="delete"?array("class" => "btn btn-danger"):array("class" => "btn btn-success")) ) ); $choices=array("oui" => "1","non" => "0"); $builder->add("fgcanshare", ChoiceType::class,array( "label" =>"Partage dans le groupe activé", 'disabled' => ($options["mode"]=="delete"?true:false), "attr" => array("class" => "form-control", "style" => "margin-bottom:15px"), "choices" => $choices ) ); if(!$options["updatelimite"]) { $builder->add('label', TextType::class, array( "label" =>"Label", "disabled" => ($options["mode"]=="delete"?true:false), "attr" => array("class" => "form-control", "style" => "margin-bottom:15px") ) ); $choices=array("oui" => "1","non" => "0"); $builder->add("fgopen", ChoiceType::class,array( "label" =>"Groupe Ouvert (inscription possible par les utilisateurs)", 'disabled' => ($options["mode"]=="delete"?true:false), "attr" => array("class" => "form-control", "style" => "margin-bottom:15px"), "choices" => $choices ) ); // Si masteridentity = LDAP alors on demande le filtre des utilisateurs qui appartiennent à ce groupe if($options["masteridentity"]=="LDAP") { $choices=array("oui" => "1","non" => "0"); $builder->add("fgassoc", ChoiceType::class,array( "mapped" => false, "label" => "Groupe associé à l'annuaire ?", 'disabled' => ($options["mode"]=="delete"?true:false), "attr" => array("class" => "form-control", "style" => "margin-bottom:15px"), "choices" => $choices ) ); $builder->add('ldapfilter', TextType::class, array( "label" => "Filtre LDAP des utilisateurs", "label_attr" => array("id" => "label_group_ldapfilter"), "disabled" => ($options["mode"]=="delete"?true:false), "required" => false, "attr" => array("class" => "form-control", "style" => "margin-bottom:15px") ) ); } if($options["masteridentity"]=="SSO") { $choices=array("oui" => "1","non" => "0"); $builder->add("fgassoc", ChoiceType::class,array( "mapped" => false, "label" => "Groupe associé à des attributs SSO ?", 'disabled' => ($options["mode"]=="delete"?true:false), "attr" => array("class" => "form-control", "style" => "margin-bottom:15px"), "choices" => $choices ) ); $builder->add('attributes', TextareaType::class, array( "label" => "Attributs SSO des utilisateurs", "label_attr" => array("id" => "label_group_attributes"), "disabled" => ($options["mode"]=="delete"?true:false), "required" => false, "attr" => array("rows" => 10, "class" => "form-control", "style" => "margin-bottom:15px") ) ); } } } public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(array( 'data_class' => 'Cadoles\CoreBundle\Entity\Group', 'mode' => "string", 'masteridentity' => "string", 'updatelimite' => "boolean" )); } }