mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-02 14:34:31 +02:00
Added an checkbox to change all operations of a permission.
This commit is contained in:
parent
ac302ab16a
commit
35dd1fabc0
3 changed files with 36 additions and 1 deletions
|
@ -40,6 +40,7 @@ use Symfony\Component\Form\Exception;
|
|||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\OptionsResolver\Options;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
|
@ -70,6 +71,10 @@ class PermissionType extends AbstractType implements DataMapperInterface
|
|||
return $options['name'];
|
||||
});
|
||||
|
||||
$resolver->setDefault('multi_checkbox', function (Options $options) {
|
||||
return !$options['disabled'];
|
||||
});
|
||||
|
||||
$resolver->setDefaults([
|
||||
]);
|
||||
}
|
||||
|
@ -90,6 +95,11 @@ class PermissionType extends AbstractType implements DataMapperInterface
|
|||
$builder->setDataMapper($this);
|
||||
}
|
||||
|
||||
public function buildView(FormView $view, FormInterface $form, array $options)
|
||||
{
|
||||
$view->vars['multi_checkbox'] = $options['multi_checkbox'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps the view data of a compound form to its children.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue