Commit 3fb4361a authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Fixing warning et retrait des modals génant tinymce

parent 06945413
Loading
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -7,10 +7,6 @@ use Interop\Container\ContainerInterface;
class IndexControllerFactory
{

    /**
     * @param ContainerInterface $container
     * @return IndexController
     */
    public function __invoke(ContainerInterface $container): IndexController
    {
        $controller = new IndexController();
+6 −4
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ class MacroForm extends Form
{
    use ProvidesObjectManager;

    public function init()
    public function init(): void
    {
        // code
        $this->add([
@@ -45,7 +45,8 @@ class MacroForm extends Form
            'type' => Text::class,
            'name' => 'variable',
            'options' => [
                'label' => "Variable associée * :",
                'label' => "Variable associée <span class='icon icon-obligatoire' title='Champ obligatoire'></span>  : ",
                'label_options' => [ 'disable_html_escape' => true, ],
            ],
            'attributes' => [
                'id' => 'variable',
@@ -56,7 +57,8 @@ class MacroForm extends Form
            'type' => Text::class,
            'name' => 'methode',
            'options' => [
                'label' => "Méthode associée * :",
                'label' => "Méthode associée <span class='icon icon-obligatoire' title='Champ obligatoire'></span>  : ",
                'label_options' => [ 'disable_html_escape' => true, ],
            ],
            'attributes' => [
                'id' => 'methode',
@@ -114,7 +116,7 @@ class MacroForm extends Form
        ]));
    }

    public function setOldCode($value)
    public function setOldCode($value): void
    {
        $this->get('old-code')->setValue($value);
    }
+0 −2
Original line number Diff line number Diff line
@@ -11,8 +11,6 @@ class MacroFormFactory
{

    /**
     * @param ContainerInterface $container
     * @return MacroForm
     * @throws ContainerExceptionInterface
     * @throws NotFoundExceptionInterface
     */
+2 −9
Original line number Diff line number Diff line
@@ -7,12 +7,9 @@ use UnicaenRenderer\Entity\Db\Macro;

class MacroHydrator implements HydratorInterface
{
    /**
     * @param Macro $object
     * @return array
     */
    public function extract(object $object): array
    {
        /** @var Macro $object */
        $data = [
            'code' => $object->getCode(),
            'variable' => $object->getVariable(),
@@ -22,11 +19,6 @@ class MacroHydrator implements HydratorInterface
        return $data;
    }

    /**
     * @param array $data
     * @param Macro $object
     * @return Macro
     */
    public function hydrate(array $data, $object): object
    {
        $code = (isset($data['code']) and trim($data['code']) !== null) ? trim($data['code']) : null;
@@ -34,6 +26,7 @@ class MacroHydrator implements HydratorInterface
        $methode = (isset($data['methode']) and trim($data['methode']) !== null) ? trim($data['methode']) : null;
        $description = (isset($data['description']) and trim($data['description']) !== null) ? trim($data['description']) : null;

        /** @var Macro $object */
        $object->setCode($code);
        $object->setVariable($variable);
        $object->setMethode($methode);
+10 −6
Original line number Diff line number Diff line
@@ -28,14 +28,15 @@ class TemplateForm extends Form
        return $this->getMacroService()->generateJSON();
    }

    public function init()
    public function init(): void
    {
        // code
        $this->add([
            'type' => Text::class,
            'name' => 'code',
            'options' => [
                'label' => "Code du contenu * :",
                'label' => "Code du contenu <span class='icon icon-obligatoire' title='Champ obligatoire'></span> :",
                'label_options' => [ 'disable_html_escape' => true, ],
            ],
            'attributes' => [
                'id' => 'code',
@@ -53,7 +54,8 @@ class TemplateForm extends Form
            'name' => 'type',
            'type' => Select::class,
            'options' => [
                'label' => 'Type * : ',
                'label' => "Type  <span class='icon icon-obligatoire' title='Champ obligatoire'></span> : ",
                'label_options' => [ 'disable_html_escape' => true, ],
                'empty_option' => "Sélectionner un type de contenu",
                'value_options' => [
                    Template::TYPE_PDF => "Fichier PDF",
@@ -93,7 +95,8 @@ class TemplateForm extends Form
            'name' => 'sujet',
            'type' => 'textarea',
            'options' => [
                'label' => 'Sujet (sujet du courrier électronique, nom du fichier, étiquette, ... ) * : ',
                'label' => "Sujet (sujet du courrier électronique, nom du fichier, étiquette, ... )  <span class='icon icon-obligatoire' title='Champ obligatoire'></span> : ",
                'label_options' => [ 'disable_html_escape' => true, ],
                'label_attributes' => [
                    'class' => 'control-label',
                ],
@@ -108,7 +111,8 @@ class TemplateForm extends Form
            'name' => 'corps',
            'type' => 'textarea',
            'options' => [
                'label' => 'Corps * : ',
                'label' => "Corps  <span class='icon icon-obligatoire' title='Champ obligatoire'></span>  : ",
                'label_options' => [ 'disable_html_escape' => true, ],
                'label_attributes' => [
                    'class' => 'control-label',
                ],
@@ -177,7 +181,7 @@ class TemplateForm extends Form
        ]));
    }

    public function setOldCode($value)
    public function setOldCode($value): void
    {
        $this->get('old-code')->setValue($value);
    }
Loading