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

Gestion plus fine de la position (bis)

parent 928134c9
Loading
Loading
Loading
Loading
+13 −0
Changes for module/Application/src/Application/Service/Activite/ActiviteService.php: 13 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -184,6 +184,17 @@ class ActiviteService {
        }
    }

    public function compacting($fiche) {
        $activites = $this->getActivitesByFicheMetierType($fiche);

        $position = 1;
        foreach ($activites as $activite) {
            $activite->setPosition($position);
            $this->updateFicheMetierTypeActivite($activite);
            $position++;
        }
    }

    public function createFicheMetierTypeActivite($fiche, $activite)
    {
        $activites = $this->getActivitesByFicheMetierType($fiche);
@@ -221,5 +232,7 @@ class ActiviteService {
        } catch (OptimisticLockException $e) {
            throw new RuntimeException('Un problème est survenu lors de la suppression en BD', $e);
        }

        $this->compacting($couple->getFiche());
    }
}
 No newline at end of file
+1 −1
Changes for module/Application/view/application/fiche-metier-type/afficher.phtml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ $canEditer = true;


        <?php foreach ($activites as $ficheActivite): ?>
        <h3> <?php echo $ficheActivite->getPosition() . " -> ".$ficheActivite->getActivite()->getLibelle(); ?> </h3>
        <h3> <?php echo $ficheActivite->getActivite()->getLibelle(); ?> </h3>
        <div class="row">
            <div class="col-md-1">
                <a class="btn btn-default mini"