Commit 55bfa17a authored by Alexandre Zvenigorosky's avatar Alexandre Zvenigorosky
Browse files

Merge branches 'Centres-cout' and 'master' of git.unicaen.fr:open-source/OSE into Centres-cout

# Conflicts:
#	composer.json
#	composer.lock
parent 63e5ae87
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ class CentreCoutSaisieForm extends AbstractForm
        $this->add([
            'name'    => 'libelle',
            'options' => [
                'label' => "Libelle",
                'label' => "Libellé",
            ],
            'type'    => 'Text',
        ]);
@@ -97,7 +97,7 @@ class CentreCoutSaisieForm extends AbstractForm
        ]);
        $this->get('parent')
            ->setEmptyOption("(Aucun)")
            ->setValueOptions(\UnicaenApp\Util::collectionAsOptions($this->getServiceCentreCout()->getList()));
            ->setValueOptions(\UnicaenApp\Util::collectionAsOptions($this->getParent()));

        $this->add(new Csrf('security'));
        $this->add([
@@ -114,6 +114,18 @@ class CentreCoutSaisieForm extends AbstractForm



    public function getParent()
    {
        $serviceCentreCout = $this->getServiceCentreCout();
        $qb                = $serviceCentreCout->finderByHistorique();
        $qb->andWhere('parent' == Null);
        $centreCouts = $serviceCentreCout->getList($qb);

        return $centreCouts;
    }



    /**
     * Should return an array specification compatible with
     * {@link Zend\InputFilter\Factory::createInputFilter()}.
+114 −135
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ while ($i < $nTblListe) {
<table class="table table-bordered table-sort">
    <thead>
    <th style="word-wrap: break-word ; ">Code</th>
    <th style="word-wrap: break-word ; ">Libelle</th>
    <th style="word-wrap: break-word ; ">Libellé</th>
    <th style="word-wrap: break-word ; ">Activité</th>
    <th style="word-wrap: break-word ; ">Type de ressource</th>
    <th style="word-wrap: break-word ; ">Unité budgétaire</th>
@@ -51,7 +51,6 @@ while ($i < $nTblListe) {
         $i++) {
        $fr  = $tblRef[$i];
        $nFr = count($tblListe[$i]); ?>
        <tr>
        <td data-order="<?= $fr->getCode() ?>"><?= $fr->getCode() ?><br></td>
        <td><?= $fr->getLibelle() . '<br>' ?></td>
        <td><?= $fr->getActivite()->getLibelle() . '<br>' ?></td>
@@ -85,20 +84,10 @@ while ($i < $nTblListe) {
                }
            }
            if ($tblOk) { ?>
                    <table class="table table-bordered">
                        <thead>
                        <th>Désignation</th>
                        <th> Actions</th>
                        <?php // if ($okActions) echo '<th>Actions</th>' ?>
                        </thead>
                        <tbody>
                <?php foreach ($centreCoutStructures as $ccs) {
                    if ($ccs->getCentreCout()->getId() == $fr->getId()) { ?>
                                <tr>
                                    <td><?= $ccs->getStructure() ?></td>
                                    <td>
                        <?= $ccs->getStructure() ?>
                        <?php if (($ccs->getSource()->getLibelle() == 'OSE') && $canEdit) { ?>
                                    <td>
                            <a class="ajax-modal" data-event="centre-cout-saisie"
                               href="<?= $this->url('centre-cout/saisie-structure', ['centre-cout' => $fr->getId(), 'centre-cout-structure' => $ccs->getId()]) ?>"
                               title="Modifier la structure">
@@ -115,15 +104,18 @@ while ($i < $nTblListe) {
                                <span class="glyphicon glyphicon-remove"></span>
                            </a>
                        <?php } ?>
                                    </td>
                                </tr>
                        <br>
                    <?php }
                } ?>
                        </tbody>
                    </table>
            <?php } ?>
            <?php if ($canEdit) { ?>
                <a class="ajax-modal" data-event="centre-cout-saisie"
                   href="<?= $this->url('centre-cout/saisie-structure', ['centre-cout' => $fr->getId()]) ?>"
                   title="Ajouter une structure">
                    <button type="button" class="btn btn-xs btn-primary">Ajouter une structure</button>
                </a>
            <?php } ?>
        </td>

        </tr>
        <?php if ($nFr) { ?>
            <?php
@@ -131,7 +123,6 @@ while ($i < $nTblListe) {
                 $j < $nFr;
                 $j++) {
                $frf = $tblListe[$i][$j]; ?>
                <tr>
                <td data-order="<?= $fr->getCode() ?>"
                    style="word-wrap: break-word; padding-left:30px; "><?= $frf->getCode() ?></td>
                <td style="word-wrap: break-word ; "><?= $frf->getLibelle() ?></td>
@@ -166,19 +157,10 @@ while ($i < $nTblListe) {
                            if (($ccs->getSource()->getLibelle() == 'OSE') && $canEdit) $okActions = true;
                        }
                    }
                        if ($tblOk) { ?>
                            <table class="table table-bordered">
                                <thead>
                                <th>Désignation</th>
                                <th> Actions</th>
                                <?php // if ($okActions) echo '<th>Actions</th>' ?>
                                </thead>
                                <tbody>
                                <?php foreach ($centreCoutStructures as $ccs) {
                    if ($tblOk) {
                        foreach ($centreCoutStructures as $ccs) {
                            if ($ccs->getCentreCout()->getId() == $frf->getId()) { ?>
                                        <tr>
                                            <td><?= $ccs->getStructure() ?></td>
                                            <td>
                                <?= $ccs->getStructure() ?>
                                <?php if (($ccs->getSource()->getLibelle() == 'OSE') && $canEdit) { ?>
                                    <a class="ajax-modal" data-event="centre-cout-saisie"
                                       href="<?= $this->url('centre-cout/saisie-structure', ['centre-cout' => $fr->getId(), 'centre-cout-structure' => $ccs->getId()]) ?>"
@@ -196,14 +178,11 @@ while ($i < $nTblListe) {
                                        <span class="glyphicon glyphicon-remove"></span>
                                    </a>
                                <?php } ?>
                                            </td>
                                        </tr>
                                <br>
                            <?php }
                        } ?>
                                </tbody>
                            </table>
                    <?php } ?>
                        <?php if (($canEdit) && ($frf->getSource()->getLibelle() == 'OSE')) { ?>
                    <?php if ($canEdit) { ?>
                        <a class="ajax-modal" data-event="centre-cout-saisie"
                           href="<?= $this->url('centre-cout/saisie-structure', ['centre-cout' => $frf->getId()]) ?>"
                           title="Ajouter une structure">