diff --git a/lib/Alchemy/Phrasea/Application.php b/lib/Alchemy/Phrasea/Application.php index d556939bed..25fa5da095 100644 --- a/lib/Alchemy/Phrasea/Application.php +++ b/lib/Alchemy/Phrasea/Application.php @@ -527,19 +527,18 @@ class Application extends SilexApplication { $this['twig'] = $this->share( $this->extend('twig', function ($twig, $app) { + $paths = array(); if ($app['browser']->isTablet() || $app['browser']->isMobile()) { - $app['twig.loader.filesystem']->setPaths(array( - realpath(__DIR__ . '/../../../config/templates/mobile'), - realpath(__DIR__ . '/../../../templates/mobile'), - )); - } else { - $app['twig.loader.filesystem']->setPaths(array( - realpath(__DIR__ . '/../../../config/templates/web'), - realpath(__DIR__ . '/../../../templates/web'), - )); + $paths[] = $app['root.path'] . '/config/templates/mobile'; + $paths[] = $app['root.path'] . '/templates/mobile'; } + $paths[] = $app['root.path'] . '/config/templates/web'; + $paths[] = $app['root.path'] . '/templates/web'; + + $app['twig.loader.filesystem']->setPaths($paths); + $twig->addGlobal('current_date', new \DateTime()); $twig->addExtension(new \Twig_Extension_Core()); diff --git a/lib/Alchemy/Phrasea/Controller/Lightbox.php b/lib/Alchemy/Phrasea/Controller/Lightbox.php index 2fd0708efd..0e2a3d487c 100644 --- a/lib/Alchemy/Phrasea/Controller/Lightbox.php +++ b/lib/Alchemy/Phrasea/Controller/Lightbox.php @@ -278,7 +278,7 @@ class Lightbox implements ControllerProviderInterface $app['EM']->flush(); } - if ($basket->getValidation() && $basket->getValidation()->getParticipant($app['authentication']->getUser())->getIsAware() === false) { + if ($basket->getValidation() && $basket->getValidation()->getParticipant($app['authentication']->getUser(), $app)->getIsAware() === false) { $basket = $app['EM']->merge($basket); $basket->getValidation()->getParticipant($app['authentication']->getUser(), $app)->setIsAware(true); $app['EM']->flush(); diff --git a/lib/classes/eventsmanager/notify/validate.php b/lib/classes/eventsmanager/notify/validate.php index 7cf1abb7a1..c209d2003d 100644 --- a/lib/classes/eventsmanager/notify/validate.php +++ b/lib/classes/eventsmanager/notify/validate.php @@ -113,6 +113,7 @@ class eventsmanager_notify_validate extends eventsmanager_notifyAbstract $mail = MailInfoValidationRequest::create($this->app, $receiver, $emitter, $params['message']); $mail->setButtonUrl($params['url']); $mail->setTitle($title); + $mail->setUser($user_from); $this->app['notification.deliverer']->deliver($mail, $params['accuse']); $mailed = true; diff --git a/lib/classes/eventsmanager/notify/validationdone.php b/lib/classes/eventsmanager/notify/validationdone.php index fa54d95873..f4096351f4 100644 --- a/lib/classes/eventsmanager/notify/validationdone.php +++ b/lib/classes/eventsmanager/notify/validationdone.php @@ -108,6 +108,7 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract $mail = MailInfoValidationDone::create($this->app, $receiver, $emitter); $mail->setButtonUrl($params['url']); $mail->setTitle($title); + $mail->setUser($user_from); $this->app['notification.deliverer']->deliver($mail); $mailed = true; diff --git a/templates/mobile/common/index.html.twig b/templates/mobile/common/index.html.twig index 0e580698ba..e1dd51535b 100644 --- a/templates/mobile/common/index.html.twig +++ b/templates/mobile/common/index.html.twig @@ -5,12 +5,12 @@
{% set basket_length = basket.getElements().count() %} {% trans %}{{basket_length}} documents{% endtrans %} @@ -37,7 +43,12 @@