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

Gestion de la partie spécificité du poste

parent a2129f96
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -238,6 +238,7 @@ class FicheMetierController extends AbstractActionController

        /** @var SpecificitePosteForm $form */
        $form = $form = $this->getServiceLocator()->get('FormElementManager')->get(SpecificitePosteForm::class);
        $form->setAttribute('action', $this->url()->fromRoute('fiche-metier/specificite', ['fiche' => $fiche->getId()], [], true));
        $form->bind($specificite);

        /** @var Request $request */
@@ -252,12 +253,10 @@ class FicheMetierController extends AbstractActionController
            }
        }

        $vm = new ViewModel();
        $vm->setTemplate('application/default/default-form');
        $vm->setVariables([
        return new ViewModel([
            'title' => 'Éditer spécificité du poste',
            'form' => $form,
        ]);
        return $vm;

    }
}
 No newline at end of file
+6 −6
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ class SpecificitePosteForm extends Form {
                ],
            ],
            'attributes' => [
                'class' => 'type2 form-control',
                'class' => 'type2 form-control specificite',
            ]
        ]);
        // encadrement
@@ -34,7 +34,7 @@ class SpecificitePosteForm extends Form {
                ],
            ],
            'attributes' => [
                'class' => 'type2 form-control',
                'class' => 'type2 form-control encadrement',
            ]
        ]);
        // relations internes
@@ -48,7 +48,7 @@ class SpecificitePosteForm extends Form {
                ],
            ],
            'attributes' => [
                'class' => 'type2 form-control',
                'class' => 'type2 form-control relations_internes',
            ]
        ]);
        // relation externes
@@ -62,7 +62,7 @@ class SpecificitePosteForm extends Form {
                ],
            ],
            'attributes' => [
                'class' => 'type2 form-control',
                'class' => 'type2 form-control relations_externes',
            ]
        ]);
        // contraintes
@@ -76,7 +76,7 @@ class SpecificitePosteForm extends Form {
                ],
            ],
            'attributes' => [
                'class' => 'type2 form-control',
                'class' => 'type2 form-control contraintes',
            ]
        ]);
        // moyens
@@ -90,7 +90,7 @@ class SpecificitePosteForm extends Form {
                ],
            ],
            'attributes' => [
                'class' => 'type2 form-control',
                'class' => 'type2 form-control moyens',
            ]
        ]);
        // button
+15 −1
Original line number Diff line number Diff line
@@ -269,7 +269,9 @@ $canEditer = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPr

        <?php if($canEditer) : ?>
            <a href="<?php echo $this->url('fiche-metier/specificite',['fiche' => $fiche->getId()], [], true); ?>"
               class="btn btn-primary action ajax-modal">
               class="btn btn-primary action ajax-modal"
               data-event="modification"
            >
                <span class="glyphicon glyphicon-pencil"></span>
                Éditer la spécificité du poste
            </a>
@@ -318,3 +320,15 @@ $canEditer = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPr

    </div>
</div>



<script>
    $(function() {
        $("body").on("modification", function (event) {
            event.div.modal('hide');
            window.location.reload();
        });
    });

</script>
+125 −0
Original line number Diff line number Diff line
<?php

/**
 * @var Form $form
 */

use Zend\Form\Form;

?>

<?php echo $this->form($form); ?>

<script>
    $(document).ready(function() {
        // tinymce.remove();
        tinymce.init({
            selector: '.specificite',
            toolbar: 'newdocument undo redo | bold italic | bullist',
            resize: true,
            language: 'fr_FR',
            plugins: 'lists',
            statusbar: true,
            browser_spellcheck : true,
            branding: false,
            menu: {},
            body_id: 'specificite',
            setup: function (editor) {
                editor.on("focusout", function () {
                    console.log(tinymce.get('specificite').getContent());
                    $('textarea#specificite').val(tinymce.get('specificite').getContent());
                });
            }
        });
        tinymce.init({
            selector: '.encadrement',
            toolbar: 'newdocument undo redo | bold italic | bullist',
            resize: true,
            language: 'fr_FR',
            plugins: 'lists',
            statusbar: true,
            browser_spellcheck : true,
            branding: false,
            menu: {},
            body_id: 'encadrement',
            setup: function (editor) {
                editor.on("focusout", function () {
                    console.log(tinymce.get('encadrement').getContent());
                    $('textarea#encadrement').val(tinymce.get('encadrement').getContent());
                });
            }
        });
        tinymce.init({
            selector: '.relations_internes',
            toolbar: 'newdocument undo redo | bold italic | bullist',
            resize: true,
            language: 'fr_FR',
            plugins: 'lists',
            statusbar: true,
            browser_spellcheck : true,
            branding: false,
            menu: {},
            body_id: 'relations_internes',
            setup: function (editor) {
                editor.on("focusout", function () {
                    console.log(tinymce.get('relations_internes').getContent());
                    $('textarea#relations_internes').val(tinymce.get('relations_internes').getContent());
                });
            }
        });
        tinymce.init({
            selector: '.relations_externes',
            toolbar: 'newdocument undo redo | bold italic | bullist',
            resize: true,
            language: 'fr_FR',
            plugins: 'lists',
            statusbar: true,
            browser_spellcheck : true,
            branding: false,
            menu: {},
            body_id: 'relations_externes',
            setup: function (editor) {
                editor.on("focusout", function () {
                    console.log(tinymce.get('relations_externes').getContent());
                    $('textarea#relations_externes').val(tinymce.get('relations_externes').getContent());
                });
            }
        });
        tinymce.init({
            selector: '.contraintes',
            toolbar: 'newdocument undo redo | bold italic | bullist',
            resize: true,
            language: 'fr_FR',
            plugins: 'lists',
            statusbar: true,
            browser_spellcheck : true,
            branding: false,
            menu: {},
            body_id: 'contraintes',
            setup: function (editor) {
                editor.on("focusout", function () {
                    console.log(tinymce.get('contraintes').getContent());
                    $('textarea#contraintes').val(tinymce.get('contraintes').getContent());
                });
            }
        });
        tinymce.init({
            selector: '.moyens',
            toolbar: 'newdocument undo redo | bold italic | bullist',
            resize: true,
            language: 'fr_FR',
            plugins: 'lists',
            statusbar: true,
            browser_spellcheck : true,
            branding: false,
            menu: {},
            body_id: 'moyens',
            setup: function (editor) {
                editor.on("focusout", function () {
                    console.log(tinymce.get('moyens').getContent());
                    $('textarea#moyens').val(tinymce.get('moyens').getContent());
                });
            }
        });
    });
</script>
 No newline at end of file