Commit 37e214d6 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Merge branch 'master' of git.unicaen.fr:dsi/sygal

parents 35fcf828 d77b3c3f
Loading
Loading
Loading
Loading
Loading
+18 −3
Changes for module/Application/src/Application/Entity/Db/Repository/VariableRepository.php: 18 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace Application\Entity\Db\Repository;

use Application\Constants;
use Application\Entity\Db\Etablissement;
use Application\Entity\Db\These;
use Application\Entity\Db\Variable;
@@ -18,10 +19,12 @@ class VariableRepository extends DefaultEntityRepository
     */
    public function findByCodeAndThese($code, These $these)
    {
        $dateObservation = $these->getDateSoutenance() ?: $these->getDatePrevisionSoutenance();

        return $this->findByCodeAndEtab(
            $code,
            $these->getEtablissement(),
            $these->getDateSoutenance() ?: $these->getDatePrevisionSoutenance());
            $dateObservation ?: new \DateTime());
    }

    /**
@@ -61,7 +64,13 @@ class VariableRepository extends DefaultEntityRepository

        if (! is_array($code)) {
            $variable =  current($results) ?: null;
            if ($variable === null) throw new RuntimeException("La valeur pour le variable [".$code."] est manquante pour l'établissement [".$etab->getCode()."].");
            if ($variable === null) {
                throw new RuntimeException(sprintf(
                    "La valeur de la variable '%s' est manquante pour l'établissement '%s' " .
                    "à la date d'observation %s.",
                    $code, $etab->getCode(), $dateObservation->format(Constants::DATE_FORMAT)
                ));
            }
            return $variable;
        }

@@ -70,7 +79,13 @@ class VariableRepository extends DefaultEntityRepository
            $variables[$v->getCode()] = $v;
        }
        foreach ($code as $c) {
            if (!isset($variables[$c])) throw new RuntimeException("La valeur pour le variable [".$c."] est manquante pour l'établissement [".$etab->getCode()."].");
            if (!isset($variables[$c])) {
                throw new RuntimeException(sprintf(
                    "La valeur de la variable '%s' est manquante pour l'établissement '%s' " .
                    "à la date d'observation %s.",
                    $c, $etab->getCode(), $dateObservation->format(Constants::DATE_FORMAT)
                ));
            }
        }

        return $variables;
+1 −1
Changes for module/Application/src/Application/Notification/ResultatTheseAdmisNotification.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ class ResultatTheseAdmisNotification extends Notification
{
    use TheseAwareTrait;

    protected $templatePath = 'application/these/mail/notif-resultat-these-modifie';
    protected $templatePath = 'application/import/mail/notif-resultat-admis-doctorant';

    /**
     * @return static
+1 −1
Changes for module/Application/src/Application/Notification/ResultatTheseModifieNotification.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ class ResultatTheseModifieNotification extends Notification
{
    use TheseAwareTrait;

    protected $templatePath = 'application/these/mail/notif-resultat-these-modifie';
    protected $templatePath = 'application/import/mail/notif-evenement-import';

    /**
     * @return static
+7 −7
Changes for module/Application/src/Application/Service/Notification/NotificationFactoryFactory.php: 7 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -6,9 +6,10 @@ use Application\Service\EcoleDoctorale\EcoleDoctoraleService;
use Application\Service\UniteRecherche\UniteRechercheService;
use Application\Service\Variable\VariableService;
use UnicaenApp\Options\ModuleOptions;
use Zend\Mvc\Router\RouteStackInterface;
use Zend\Mvc\View\Console\ViewManager as ConsoleViewManager;
use Zend\Mvc\View\Http\ViewManager as HttpViewManager;
use Zend\ServiceManager\ServiceLocatorInterface;
use Zend\View\Helper\Url;
use Zend\View\Helper\Url as UrlHelper;

/**
 * @author Unicaen
@@ -40,11 +41,10 @@ class NotificationFactoryFactory extends \Notification\Service\NotificationFacto
        $ecoleDoctoraleService = $serviceLocator->get('EcoleDoctoraleService');
        $uniteRechercheService = $serviceLocator->get('UniteRechercheService');

        /** @var RouteStackInterface $router */
        $router = $serviceLocator->get('router');
        /* @var Url $urlHelper */
        $urlHelper = $serviceLocator->get('ViewHelperManager')->get('Url');
        $urlHelper->setRouter($router);
        /** @var HttpViewManager|ConsoleViewManager $vm */
        $vm = $serviceLocator->get('ViewManager');
        /** @var UrlHelper $urlHelper */
        $urlHelper = $vm->getHelperManager()->get('Url');

        /* @var ModuleOptions $moduleOptions */
        $moduleOptions = $serviceLocator->get('unicaen-app_module_options');
+6 −7
Changes for module/Application/src/Application/Service/Notification/NotifierServiceFactory.php: 6 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -7,7 +7,8 @@ use Application\Service\Individu\IndividuService;
use Application\Service\Role\RoleService;
use Application\Service\UniteRecherche\UniteRechercheService;
use Application\Service\Variable\VariableService;
use Zend\Mvc\Router\RouteStackInterface;
use Zend\Mvc\View\Http\ViewManager as HttpViewManager;
use Zend\Mvc\View\Console\ViewManager as ConsoleViewManager;
use Zend\ServiceManager\ServiceLocatorInterface;
use Zend\View\Helper\Url as UrlHelper;

@@ -42,12 +43,10 @@ class NotifierServiceFactory extends \Notification\Service\NotifierServiceFactor
        $individuService = $serviceLocator->get('IndividuService');
        $roleService = $serviceLocator->get('RoleService');

        /** @var RouteStackInterface $router */
        $router = $serviceLocator->get('router');
        $viewHelperManager = $serviceLocator->get('ViewHelperManager');
        /* @var UrlHelper $urlHelper */
        $urlHelper = $viewHelperManager->get('Url');
        $urlHelper->setRouter($router);
        /** @var HttpViewManager|ConsoleViewManager $vm */
        $vm = $serviceLocator->get('ViewManager');
        /** @var UrlHelper $urlHelper */
        $urlHelper = $vm->getHelperManager()->get('Url');

        /** @var NotificationFactory $notificationFactory */
        $notificationFactory = $serviceLocator->get(NotificationFactory::class);
Loading