mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 14:33:14 +00:00
Merge branch '3.6' of github.com:alchemy-fr/Phraseanet into 3.6
This commit is contained in:
@@ -78,8 +78,9 @@ return call_user_func(
|
||||
$browser = \Browser::getInstance();
|
||||
|
||||
if (!$browser->isMobile())
|
||||
|
||||
{
|
||||
return new Response('');
|
||||
}
|
||||
|
||||
|
||||
$em = $app['Core']->getEntityManager();
|
||||
@@ -241,6 +242,21 @@ return call_user_func(
|
||||
, false
|
||||
);
|
||||
|
||||
|
||||
if ($basket->getIsRead() === false)
|
||||
{
|
||||
$basket = $em->merge($basket);
|
||||
$basket->setIsRead(true);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
if ($basket->getValidation() && $basket->getValidation()->getParticipant($app['Core']->getAuthenticatedUser())->getIsAware() === false)
|
||||
{
|
||||
$basket = $em->merge($basket);
|
||||
$basket->getValidation()->getParticipant($app['Core']->getAuthenticatedUser())->setIsAware(true);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
/* @var $twig \Twig_Environment */
|
||||
$twig = $app['Core']->getTwig();
|
||||
|
||||
@@ -284,6 +300,21 @@ return call_user_func(
|
||||
, false
|
||||
);
|
||||
|
||||
|
||||
if ($basket->getIsRead() === false)
|
||||
{
|
||||
$basket = $em->merge($basket);
|
||||
$basket->setIsRead(true);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
if ($basket->getValidation() && $basket->getValidation()->getParticipant($app['Core']->getAuthenticatedUser())->getIsAware() === false)
|
||||
{
|
||||
$basket = $em->merge($basket);
|
||||
$basket->getValidation()->getParticipant($app['Core']->getAuthenticatedUser())->setIsAware(true);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
/* @var $twig \Twig_Environment */
|
||||
$twig = $app['Core']->getTwig();
|
||||
|
||||
@@ -449,16 +480,16 @@ return call_user_func(
|
||||
$repository = $em->getRepository('\Entities\BasketElement');
|
||||
|
||||
/* @var $repository \Repositories\BasketElementRepository */
|
||||
$basket_element = $repository->findUserElement(
|
||||
$basket_element = $repository->findUserElement(
|
||||
$sselcont_id
|
||||
, $user
|
||||
);
|
||||
/* @var $basket_element \Entities\BasketElement */
|
||||
$validationDatas = $basket_element->getUserValidationDatas($user);
|
||||
|
||||
if(!$basket_element->getBasket()
|
||||
->getValidation()
|
||||
->getParticipant($user)->getCanAgree())
|
||||
if (!$basket_element->getBasket()
|
||||
->getValidation()
|
||||
->getParticipant($user)->getCanAgree())
|
||||
{
|
||||
throw new ControllerException('You can not agree on this');
|
||||
}
|
||||
@@ -474,7 +505,7 @@ return call_user_func(
|
||||
$em->flush();
|
||||
|
||||
$releasable = false;
|
||||
if($participant->isReleasable() === true)
|
||||
if ($participant->isReleasable() === true)
|
||||
{
|
||||
$releasable = _('Do you want to send your report ?');
|
||||
}
|
||||
@@ -484,13 +515,12 @@ return call_user_func(
|
||||
, 'datas' => ''
|
||||
, 'releasable' => $releasable
|
||||
);
|
||||
|
||||
}
|
||||
catch(ControllerException $e)
|
||||
catch (ControllerException $e)
|
||||
{
|
||||
$ret['datas'] = $e->getMessage();
|
||||
}
|
||||
$Serializer = $app['Core']['Serializer'];
|
||||
$Serializer = $app['Core']['Serializer'];
|
||||
|
||||
return new Response(
|
||||
$Serializer->serialize($ret, 'json')
|
||||
@@ -541,7 +571,7 @@ return call_user_func(
|
||||
|
||||
$datas = array('error' => false, 'datas' => _('Envoie avec succes'));
|
||||
}
|
||||
catch(ControllerException $e)
|
||||
catch (ControllerException $e)
|
||||
{
|
||||
$datas = array('error' => true, 'datas' => $e->getMessage());
|
||||
}
|
||||
|
@@ -486,6 +486,13 @@ class Basket implements ControllerProviderInterface
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
if ($basket->getValidation() && $basket->getValidation()->getParticipant($app['Core']->getAuthenticatedUser())->getIsAware() === false)
|
||||
{
|
||||
$basket = $em->merge($basket);
|
||||
$basket->getValidation()->getParticipant($app['Core']->getAuthenticatedUser())->setIsAware(true);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
/* @var $twig \Twig_Environment */
|
||||
$twig = $app['Core']->getTwig();
|
||||
|
||||
|
@@ -221,6 +221,7 @@ class Push implements ControllerProviderInterface
|
||||
$Basket->setDescription($push_description);
|
||||
$Basket->setOwner($user_receiver);
|
||||
$Basket->setPusher($user);
|
||||
$Basket->setIsRead(false);
|
||||
|
||||
$em->persist($Basket);
|
||||
|
||||
@@ -350,6 +351,7 @@ class Push implements ControllerProviderInterface
|
||||
$Basket->setName($validation_name);
|
||||
$Basket->setDescription($validation_description);
|
||||
$Basket->setOwner($user);
|
||||
$Basket->setIsRead(false);
|
||||
|
||||
$em->persist($Basket);
|
||||
|
||||
|
@@ -76,11 +76,21 @@ class BasketRepository extends EntityRepository
|
||||
JOIN b.elements e
|
||||
LEFT JOIN b.validation s
|
||||
LEFT JOIN s.participants p
|
||||
WHERE b.usr_id = :usr_id
|
||||
AND b.archived = false AND b.is_read = false';
|
||||
WHERE b.archived = false
|
||||
AND (
|
||||
(b.usr_id = :usr_id_owner AND b.is_read = false)
|
||||
OR (b.usr_id != :usr_id_ownertwo AND p.usr_id = :usr_id_participant
|
||||
AND p.is_aware = false)
|
||||
)';
|
||||
|
||||
$params = array(
|
||||
'usr_id_owner' => $user->get_id(),
|
||||
'usr_id_ownertwo' => $user->get_id(),
|
||||
'usr_id_participant' => $user->get_id()
|
||||
);
|
||||
|
||||
$query = $this->_em->createQuery($dql);
|
||||
$query->setParameters(array('usr_id' => $user->get_id()));
|
||||
$query->setParameters($params);
|
||||
|
||||
$idCache = "findUnreadActiveByUser" . $user->get_id() . Entities\Basket::CACHE_SUFFIX;
|
||||
|
||||
|
@@ -19,15 +19,8 @@
|
||||
</span>
|
||||
</a>
|
||||
<div class="menu">
|
||||
{% if basket.getValidation() %}
|
||||
<img title="{% trans 'Vous avez envoye une demande de validation de document sur ce panier' %}"
|
||||
<img title="{% trans 'Vous avez recu une demande de validation de document sur ce panier' %}"
|
||||
class="basketTips" src="/skins/icons/valid.png"/>
|
||||
{% endif %}
|
||||
{% if basket.getPusher() %}
|
||||
{% set pusher = basket.getPusher().get_display_name() %}
|
||||
<img class="basketTips" title="{% trans %}paniers:: panier recu de {{pusher}}{% endtrans %}"
|
||||
src="/skins/icons/push16.png"/>
|
||||
{% endif %}
|
||||
<a style="cursor:pointer;display:inline;padding:0;margin:0;" class="contextMenuTrigger">▼</a>
|
||||
|
||||
<table cellspacing="0" cellpadding="0" style="display:none;" class="contextMenu basketcontextmenu">
|
||||
@@ -60,14 +53,6 @@
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div title="" class="context-menu-item">
|
||||
<div class="context-menu-item-inner"
|
||||
onclick="archiveBasket({{ basket.getId() }});return false;">
|
||||
{% trans 'Archive' %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
Reference in New Issue
Block a user