Commit 25089d61 authored by joriot221's avatar joriot221
Browse files

Correction du bouton de création de contrat suite à l'ajout d'une structure lors de contrat unique

parent 22a7e0dc
Loading
Loading
Loading
Loading
+4 −24
Changes for module/Application/view/application/contrat/index.phtml: 4 added lines, 24 removed lines.
Original line number Diff line number Diff line
@@ -65,7 +65,8 @@ $this->messenger() ?>
                </div>
            <?php else: if ($avenant_param == 0) ?>
                <div class="alert alert-info">
                    <h2>Une composante ne peut posséder qu'un seul contrat/avenant, tout avenant supplémentaire a été désactivé dans les paramètres.</h2>
                    <h2>Une composante ne peut posséder qu'un seul contrat/avenant, la création de tout avenant supplémentaire a été désactivé dans les
                        paramètres.</h2>
                </div>
            <?php endif; endif; ?>

@@ -90,7 +91,6 @@ $this->messenger() ?>
                    <td><?= $structure ?></td>
                    <td>
                        <?php if ($canCreer):
                            if ($avenant_param >= 0):
                            if ($contratDirect):?>
                                <a class="btn btn-primary"
                                   href="<?= $this->url('contrat/creer', ['intervenant' => $intervenant->getId(), 'structure' => $structure->getId()]); ?>">
@@ -102,7 +102,6 @@ $this->messenger() ?>
                                    <i class="fas fa-file"></i> Créer un projet <?= $hasContrat ? 'd\'avenant' : 'de contrat' ?>
                                </a>
                            <?php endif;
                                endif;
                        else:
                            echo $this->feuilleDeRoute($intervenant)->renderWhyNonAtteignable(\Application\Entity\Db\WfEtape::CODE_CONTRAT, $structure);
                        endif; ?>
@@ -121,26 +120,7 @@ $this->messenger() ?>
                        </div>
                    </td>
                </tr>
                <?php endforeach;
                if ($avenant_param < 0):?>
                    <tr>
                        <td></td>
                        <td>
                            <?php if ($contratDirect): ?>
                                <a class="btn btn-primary"
                                   href="<?= $this->url('contrat/creer', ['intervenant' => $intervenant->getId(), 'structure' => $structure->getId()]); ?>">
                                    <i class="fas fa-file"></i> Créer un <?= $hasContrat ? 'avenant' : 'contrat' ?>
                                </a>
                            <?php else: ?>
                                <a class="btn btn-primary"
                                   href="<?= $this->url('contrat/creer', ['intervenant' => $intervenant->getId(), 'structure' => $structure->getId()]); ?>">
                                    <i class="fas fa-file"></i> Créer un projet <?= $hasContrat ? 'd\'avenant' : 'de contrat' ?>
                                </a>
                            <?php endif; ?>
                        </td>
                    </tr>

                <?php endif; ?>
            <?php endforeach; ?>
        </table>


@@ -148,7 +128,7 @@ $this->messenger() ?>
    <div class="well">
        <h2>Contrats et avenants</h2>
        <?php foreach ($contrats as $contrat): ?>
            <?= $this->partial('application/contrat/partial/contrat', ['contrat' => $contrat, 'services' => $services['contractualises'][$contrat->getId()], 'emailIntervenant' => $emailIntervenant, 'contratDirect' => $contratDirect]);
            <?= $this->partial('application/contrat/partial/contrat', ['contrat' => $contrat, 'services' => $services['contractualises'][$contrat->getId()], 'emailIntervenant' => $emailIntervenant, 'contratDirect' => $contratDirect, 'avenant_param' => $avenant_param]);
            ?>

        <?php endforeach; ?>
+7 −1
Changes for module/Application/view/application/contrat/partial/contrat.phtml: 7 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ use Application\Provider\Privilege\Privileges;
 * @var $this          \Application\View\Renderer\PhpRenderer
 * @var $contrat       \Application\Entity\Db\Contrat
 * @var $services      \Application\Entity\Db\Service[]
 * @var $avenant_param int
 */

$validation     = $contrat->getValidation();
@@ -85,7 +86,8 @@ $panel = ($retourSigne !== null) ? 'success' : ($validation ? 'info' : 'default'
        <?php endif; ?>
        <!-- Lien de téléchargement du fichier -->

        <h3><?= $contrat->toString() ?> - <?= $contrat->getStructure() ?></h3>
        <h3><?= $contrat->toString() ?>
            <?php if ($avenant_param >= 0): ?>- <?= $contrat->getStructure() ?><?php endif; ?></h3>
    </div>

    <div class="panel-body">
@@ -108,6 +110,10 @@ $panel = ($retourSigne !== null) ? 'success' : ($validation ? 'info' : 'default'
                <li><i class="fas fa-thumbs-up"></i> Retourné signé
                    le <?= $retourSigne->format(Application\Constants::DATE_FORMAT) ?></li>
            <?php endif ?>
            <?php if ($avenant_param < 0): ?>
                <li><i class="fas fa-thumbs-up"></i> Modifiable par la structure
                    <?= $contrat->getStructure() ?></li>
            <?php endif; ?>
        </ul>

        <!-- Upload de fichiers -->