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

changement des traits et du css

parent adc68723
Loading
Loading
Loading
Loading
Loading
+2 −2
Changes for public/css/unicaen-etat.css: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
    display: inline-block;
    text-align: center;
    border-radius: 0.25rem 0 0 0.25rem;
    height: 1.2rem;
    height: 1.5rem;
}

.etat-rightpart {
@@ -18,5 +18,5 @@
    display: inline-block;
    text-align: center;
    border-radius: 0 0.25rem 0.25rem 0;
    height: 1.2rem;
    height: 1.5rem;
}
 No newline at end of file
+19 −0
Changes for src/UnicaenEtat/Entity/Db/HasEtatTrait.php: 19 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -56,5 +56,24 @@ trait HasEtatTrait {

        return $qb;
    }
    /**
     * @param QueryBuilder $qb
     * @param string $entityName
     * @param EtatType[] $etats
     * @return QueryBuilder
     */
    static public function decorateWithEtats(QueryBuilder $qb, string $entityName,  array $etats = []) : QueryBuilder
    {
        $qb = $qb
            ->leftJoin($entityName . '.etat', 'etat')->addSelect('etat')
            ->leftJoin('etat.type', 'type')->addSelect('type')
        ;

        if ($etat !== null) {
            $qb = $qb->andWhere($entityName . '.etat in (:etats)')
                ->setParameter('etats', $etats);
        }
        return $qb;
    }

}
 No newline at end of file
+22 −0
Changes for src/UnicaenEtat/Entity/Db/HasEtatsTrait.php: 22 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\PersistentCollection;
use Doctrine\ORM\QueryBuilder;
use UnicaenApp\Exception\RuntimeException;

trait HasEtatsTrait {
@@ -68,4 +69,25 @@ trait HasEtatsTrait {
        $this->etats->clear();
        return $this;
    }

    /**
     * @param QueryBuilder $qb
     * @param string $entityName
     * @param EtatType[] $etats
     * @return QueryBuilder
     */
    static public function decorateWithEtats(QueryBuilder $qb, string $entityName,  array $etats = []) : QueryBuilder
    {
        $qb = $qb
            ->leftJoin($entityName . '.etats', 'etat')->addSelect('etat')
            ->leftJoin('etat.type', 'type')->addSelect('type')
            ->andWhere('etat.histoDestruction IS NULL')
        ;

        if ($etat !== null) {
            $qb = $qb->andWhere($entityName . '.etat in (:etats)')
                ->setParameter('etats', $etats);
        }
        return $qb;
    }
}
 No newline at end of file