Commit c12b7520 authored by Florian Joriot's avatar Florian Joriot
Browse files

Merge remote-tracking branch 'origin/Bootstrap_5' into Bootstrap_5

parents 21c5b758 563051f3
Loading
Loading
Loading
Loading
+28
Changes for module/Application/src/Entity/Db/ServiceAPayerTrait.php: 28 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -2,6 +2,9 @@

namespace Application\Entity\Db;

use Service\Entity\Db\TypeVolumeHoraire;
use Service\Entity\Db\EtatVolumeHoraire;

trait ServiceAPayerTrait
{

@@ -25,6 +28,8 @@ trait ServiceAPayerTrait
     */
    private $centreCout;



    /**
     * Constructor
     */
@@ -34,6 +39,8 @@ trait ServiceAPayerTrait
        $this->centreCout     = new \Doctrine\Common\Collections\ArrayCollection();
    }



    /**
     * Get id
     *
@@ -44,30 +51,40 @@ trait ServiceAPayerTrait
        return $this->id;
    }



    /**
     * Add miseEnPaiement
     *
     * @param MiseEnPaiement $miseEnPaiement
     *
     * @return ServiceAPayerInterface
     */
    public function addMiseEnPaiement(\Application\Entity\Db\MiseEnPaiement $miseEnPaiement)
    {
        $this->miseEnPaiement[] = $miseEnPaiement;

        return $this;
    }



    /**
     * Remove miseEnPaiement
     *
     * @param \Application\Entity\Db\MiseEnPaiement $miseEnPaiement
     *
     * @return ServiceAPayerInterface
     */
    public function removeMiseEnPaiement(\Application\Entity\Db\MiseEnPaiement $miseEnPaiement)
    {
        $this->miseEnPaiement->removeElement($miseEnPaiement);

        return $this;
    }



    /**
     * Get miseEnPaiement
     *
@@ -78,10 +95,13 @@ trait ServiceAPayerTrait
        return $this->miseEnPaiement;
    }



    /**
     * Get centreCout
     *
     * @param TypeHeures $typeHeures
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getCentreCout(TypeHeures $typeHeures = null)
@@ -93,9 +113,12 @@ trait ServiceAPayerTrait
                return true;
            }
        };

        return $this->centreCout->filter($filter);
    }



    /**
     * @return MiseEnPaiementListe
     */
@@ -104,9 +127,12 @@ trait ServiceAPayerTrait
        $liste = new MiseEnPaiementListe($this);
        if ($dateMiseEnPaiement) $liste->setDateMiseEnPaiement($dateMiseEnPaiement);
        if ($periodePaiement) $liste->setPeriodePaiement($periodePaiement);

        return $liste;
    }



    /**
     * Get formuleResultat
     *
@@ -117,6 +143,8 @@ trait ServiceAPayerTrait
        return $this->formuleResultat;
    }



    /**
     * @retun boolean
     */
+42 −4
Changes for module/Application/src/Form/Intervenant/ContratRetour.php: 42 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -2,8 +2,10 @@

namespace Application\Form\Intervenant;

use Application\Constants;
use Application\Entity\Db\Traits\ContratAwareTrait;
use Application\Form\AbstractForm;
use Laminas\Hydrator\HydratorInterface;
use UnicaenApp\Hydrator\Strategy\DateStrategy;
use Laminas\Form\Element\Csrf;
use Laminas\Hydrator\ClassMethodsHydrator;
@@ -18,7 +20,7 @@ class ContratRetour extends AbstractForm

    public function init2()
    {
        $this->setHydrator(new ClassMethodsHydrator(false));
        $this->setHydrator(new ContratRetourFormHydrator());
        $this->setAttribute('method', 'POST');
        $this->setAttribute('action', $this->getCurrentUrl());

@@ -26,9 +28,10 @@ class ContratRetour extends AbstractForm

        $this->add([
            'name'       => 'dateRetourSigne',
            'type'       => 'UnicaenApp\Form\Element\Date',
            'type'       => 'DateTime',
            'options'    => [
                'label'  => "Date de retour $contratToString signé",
                'format' => Constants::DATE_FORMAT,
            ],
            'attributes' => [
            ],
@@ -44,8 +47,6 @@ class ContratRetour extends AbstractForm
            ],
        ]);

        $this->getHydrator()->addStrategy('dateRetourSigne', new DateStrategy($this->get('dateRetourSigne')));

        return $this;
    }

@@ -66,3 +67,40 @@ class ContratRetour extends AbstractForm
        ];
    }
}





class ContratRetourFormHydrator implements HydratorInterface
{

    /**
     * @param array          $data
     * @param CampagneSaisie $object
     *
     * @return CampagneSaisie
     */
    public function hydrate(array $data, $object)
    {
        $object->setDateRetourSigne($data['dateRetourSigne'] ? \DateTime::createFromFormat(Constants::DATE_FORMAT, $data['dateRetourSigne']) : null);

        return $object;
    }



    /**
     * @param CampagneSaisie $object
     *
     * @return array
     */
    public function extract($object): array
    {
        $data = [
            'dateRetourSigne' => $object->getDateRetourSigne() ? $object->getDateRetourSigne()->format(Constants::DATE_FORMAT) : null,
        ];

        return $data;
    }
}
 No newline at end of file
+7 −4
Changes for module/Application/src/View/Helper/Paiement/DemandeMiseEnPaiementViewHelper.php: 7 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -300,14 +300,17 @@ class DemandeMiseEnPaiementViewHelper extends AbstractViewHelper
            'id'          => (string)self::$miseEnPaiementListeIdSequence++,
            'data-params' => json_encode($params),
        ];
        if ($notAllowed && !$saisieTerminee) $attrs['class'][] = 'bg-warning';
        $hattrs = [
            'class' => [],
        ];
        if ($notAllowed && !$saisieTerminee) $hattrs['class'][] = 'bg-warning';
        if ($readOnly) $attrs['class'][] = 'read-only';
        if ($saisieTerminee) $attrs['class'][] = 'bg-success';
        if ($saisieTerminee) $hattrs['class'][] = 'bg-success';
        if (!$serviceAPayer->isPayable()) {
            $out .= '<div class="alert alert-danger" role="alert">Des heures à payer ont été positionnées sur ce service alors que c\'est normalement impossible.</div>';
        }
        $out .= '<table ' . $this->htmlAttribs($attrs) . '>';
        $out .= '<thead><tr><th colspan="3">' . $typeHeures->getLibelleLong() . '</th></tr><tr>';
        $out .= '<thead ' . $this->htmlAttribs($hattrs) . '><tr><th colspan="3">' . $typeHeures->getLibelleLong() . '</th></tr><tr>';
        $out .= '<th style="width:8em"><abbr title="Heures équivalent TD">HETD</abbr></th>';
        $out .= '<th>Centre de coûts</th>';
        if ($serviceAPayer->isDomaineFonctionnelModifiable()) {
@@ -322,7 +325,7 @@ class DemandeMiseEnPaiementViewHelper extends AbstractViewHelper
                $title[] = $periode . ' : ' . strip_tags(\UnicaenApp\Util::formattedNumber($heures)) . ' hetd mis en paiement';
            }
            $title = implode('&#13;', $title);
            $out   .= '<tr><td class="nombre"><abbr title="' . $title . '">' . \UnicaenApp\Util::formattedNumber($params['heures-mep']) . '</td><td>HETD déjà mises en paiement</td></tr>';
            $out   .= '<tr><td class="nombre"><abbr title="' . $title . '">' . \UnicaenApp\Util::formattedNumber($params['heures-mep']) . '</td><td>HETD déjà mises en paiement</td><td></td></tr>';
        }
        $out .= '<tfoot>';

+3 −5
Changes for module/Application/view/application/contrat/partial/contrat.phtml: 3 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -172,11 +172,9 @@ $card = ($retourSigne !== null) ? 'success' : ($validation ? 'info' : 'default')
            <?php endif; ?>

            <?php if ($urlSaisieRetour): ?>
                <a href="<?= $urlSaisieRetour ?>" class="btn btn-primary pop-ajax"
                   data-submit-reload="true">
                    <i
                            class="fas fa-calendar-days"></i> <?= $contrat->getDateRetourSigne() ? 'Modifier' : 'Saisir' ?>
                    la date de retour signé
                <a href="<?= $urlSaisieRetour ?>" class="btn btn-primary pop-ajax" data-submit-reload="true">
                    <i class="fas fa-calendar-days"></i>
                    <?= $contrat->getDateRetourSigne() ? 'Modifier' : 'Saisir' ?> la date de retour signé
                </a>
            <?php endif; ?>

+1 −1
Changes for module/Application/view/unicaen-app/application/apropos.phtml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ $this->headTitle()->append($title = "À propos...");

?>
<div style="margin: 1em">
    <div class="card bg-success">
    <div class="card bg-default">
        <div class="card-header">
            <?= $title ?>
        </div>
Loading