Commit 910398ee authored by root's avatar root
Browse files

Merge branch 'master' of https://git.unicaen.fr/dsi/preecog

parents 9bca11cf c893fa6e
Loading
Loading
Loading
Loading
+2 −2
Changes for module/Application/src/Application/Form/SelectionAgent/SelectionAgentFormAwareTrait.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ trait SelectionAgentFormAwareTrait {
    /**
     * @return SelectionAgentForm
     */
    public function getSelectionAgentForm()
    public function getSelectionAgentForm() : SelectionAgentForm
    {
        return $this->selectionAgentForm;
    }
@@ -19,7 +19,7 @@ trait SelectionAgentFormAwareTrait {
     * @param SelectionAgentForm $selectionAgentForm
     * @return SelectionAgentForm
     */
    public function setSelectionAgentForm($selectionAgentForm)
    public function setSelectionAgentForm(SelectionAgentForm $selectionAgentForm) : SelectionAgentForm
    {
        $this->selectionAgentForm = $selectionAgentForm;
        return $this->selectionAgentForm;
+13 −4
Changes for module/EntretienProfessionnel/src/EntretienProfessionnel/Controller/EntretienProfessionnelController.php: 13 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -119,9 +119,9 @@ class EntretienProfessionnelController extends AbstractActionController
        $term = $this->params()->fromQuery('term');

        if ($term !== null and trim($term) !== "") {
            $agentsResponsables = $this->getEntretienProfessionnelService()->findResponsablePourEntretien($structure, $term);
            $agentsDelegues = $this->getEntretienProfessionnelService()->findDeleguePourEntretien($structure, $campagne, $term);
            $agentsSuperieures = $this->getEntretienProfessionnelService()->findSuperieurPourEntretien($agent, $term);
            $agentsResponsables = ($structure)?$this->getEntretienProfessionnelService()->findResponsablePourEntretien($structure, $term):[];
            $agentsDelegues = ($campagne AND $structure)?$this->getEntretienProfessionnelService()->findDeleguePourEntretien($structure, $campagne, $term):[];
            $agentsSuperieures = ($agent)?$this->getEntretienProfessionnelService()->findSuperieurPourEntretien($agent, $term):[];
            $result = $this->getAgentService()->formatAgentJSON(array_merge($agentsResponsables, $agentsDelegues, $agentsSuperieures));
            return new JsonModel($result);
        }
@@ -185,7 +185,12 @@ class EntretienProfessionnelController extends AbstractActionController
            /** @var SearchAndSelect $element */
            $element = $form->get('responsable');
            /** @see EntretienProfessionnelController::findResponsablePourEntretienAction() */
            $element->setAutocompleteSource($this->url()->fromRoute('entretien-professionnel/find-responsable-pour-entretien', ['structure' => $structure->getId(), 'campagne' => $campagne->getId()], ['query' => ['agent' => $agentId]], true));
            $element->setAutocompleteSource($this->url()->fromRoute('entretien-professionnel/find-responsable-pour-entretien', ['agent' => $agent->getId(), 'structure' => $structure->getId(), 'campagne' => $campagne->getId()], ['query' => ['agent' => $agentId]], true));
        } else {
            /** @var SearchAndSelect $element */
            $element = $form->get('responsable');
            /** @see EntretienProfessionnelController::findResponsablePourEntretienAction() */
            $element->setAutocompleteSource($this->url()->fromRoute('entretien-professionnel/find-responsable-pour-entretien', [], ['query' => ['agent' => $agentId]], true));
        }

        /** @var Request $request */
@@ -228,7 +233,11 @@ class EntretienProfessionnelController extends AbstractActionController
        $form->bind($entretien);
        /** @var SearchAndSelect $element */
        $element = $form->get('responsable');
        if ($structure !== null) {
            $element->setAutocompleteSource($this->url()->fromRoute('entretien-professionnel/find-responsable-pour-entretien', ['structure' => $structure->getId(), 'campagne' => $campagne->getId()], ["query" => ["agent" => $agent->getId()]], true));
        } else {
            $element->setAutocompleteSource($this->url()->fromRoute('entretien-professionnel/find-responsable-pour-entretien', [], ['query' => ['agent' => $agent->getId()]], true));
        }
        $element = $form->get('agent');
        $element->setAttribute('readonly', true);

+1 −2
Changes for module/EntretienProfessionnel/src/EntretienProfessionnel/Form/EntretienProfessionnel/EntretienProfessionnelForm.php: 1 added line, 2 removed lines.
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@

namespace EntretienProfessionnel\Form\EntretienProfessionnel;

use DateInterval;
use DateTime;
use EntretienProfessionnel\Entity\Db\EntretienProfessionnel;
use EntretienProfessionnel\Service\Campagne\CampagneServiceAwareTrait;
@@ -145,7 +144,7 @@ class EntretienProfessionnelForm extends Form {
                        'name' => Callback::class,
                        'options' => [
                            'messages' => [
                                Callback::INVALID_VALUE => "Veuillez sélectionnez un responsable dans la liste déroulante.",
                                Callback::INVALID_VALUE => "Veuillez sélectionner un responsable dans la liste déroulante.",
                            ],
                            'callback' => function ($value, $context = []) {
                                $hasResponsable = (isset($context['responsable']) AND isset($context['responsable']['id']) AND trim($context['responsable']['id']) !== '');
+1
Changes for module/Structure/view/structure/structure/partial/agents.phtml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@ $isForce = (isset($options['force']) AND $options['force'] === true);
                    <br/>
                <?php endforeach; ?>
                <?php if ($canComplement) : ?>
                    <?php /** @see \Application\Controller\ComplementController::ajouterAction() */ ?>
                    <a href="<?php echo $this->url('complement/ajouter', ['type' => Complement::COMPLEMENT_TYPE_RESPONSABLE, 'attachmenttype' => Agent::class, 'attachmentid' => $agent->getId()], [], true); ?>" class="ajax-modal" data-event="modification">
                        <span class="icon ajouter"></span> Ajouter un&middot;e supérieur&middot;e
                    </a>