use Lc\SovBundle\Field\Filter\FilterManager; | use Lc\SovBundle\Field\Filter\FilterManager; | ||||
use Lc\SovBundle\Form\Common\FiltersFormType; | use Lc\SovBundle\Form\Common\FiltersFormType; | ||||
use Lc\SovBundle\Form\Common\PositionType; | use Lc\SovBundle\Form\Common\PositionType; | ||||
use Lc\SovBundle\Model\User\UserInterface; | |||||
use Lc\SovBundle\Repository\EntityRepository; | use Lc\SovBundle\Repository\EntityRepository; | ||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
use Lc\SovBundle\Translation\FlashBagTranslator; | use Lc\SovBundle\Translation\FlashBagTranslator; | ||||
$action->setLinkUrl($url); | $action->setLinkUrl($url); | ||||
} | } | ||||
} | } | ||||
if ($action->getName() == ActionDefinition::WRITE_TO_USER) { | |||||
$entity = $context->getEntity()->getInstance(); | |||||
if ($entity !== null) { | |||||
if(method_exists($entity, 'getUser')){ | |||||
$url = $this->generateEaUrl(UserA) ->setController($context->getCrud()->getControllerFqcn()) | |||||
->set('entityId', $entity->getParent()->getId()) | |||||
->generateUrl(); | |||||
$action->setLinkUrl($url); | |||||
} | |||||
} else { | |||||
unset($actions[$i]); | |||||
} | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
public function handleTreeEntityActions(Actions $actions): void | public function handleTreeEntityActions(Actions $actions): void | ||||
{ | { | ||||
if ($this->isInstanceOf(TreeInterface::class)) { | if ($this->isInstanceOf(TreeInterface::class)) { |
public const SAVE_AND_CONTINUE = 'saveAndContinue'; | public const SAVE_AND_CONTINUE = 'saveAndContinue'; | ||||
public const SAVE_AND_RETURN = 'saveAndReturn'; | public const SAVE_AND_RETURN = 'saveAndReturn'; | ||||
public const SWITCH_USER = 'switchUser'; | public const SWITCH_USER = 'switchUser'; | ||||
public const WRITE_TO_USER = 'writeToUser'; | |||||
} | } |
Pense-bête | Pense-bête | ||||
</a> | </a> | ||||
</li> | </li> | ||||
{# TODO Adapter Pour Caracole #} | |||||
{# <li class="nav-item">#} | |||||
{# <a href="{{ path(sov_homepage_route(), {section: section_slug_current()}) }}" class="btn btn-sm btn-block btn-outline-success" target="_blank"#} | |||||
{# rel="noreferrer">#} | |||||
{# <i class="action-icon fa fa-eye"></i>#} | |||||
{# Afficher le site#} | |||||
{# </a>#} | |||||
{# </li>#} | |||||
<li class="nav-item"> | |||||
<a href="{{ path(sov_homepage_route()) }}" class="btn btn-sm btn-block btn-outline-success" target="_blank" | |||||
rel="noreferrer"> | |||||
<i class="action-icon fa fa-eye"></i> | |||||
Afficher le site | |||||
</a> | |||||
</li> | |||||
</ul> | </ul> | ||||
</nav> | </nav> |
<div class="btn-list float-sm-right"> | <div class="btn-list float-sm-right"> | ||||
{% block global_actions %} | |||||
<div class="global-actions"> | |||||
<div class="global-actions"> | |||||
{% block global_actions %} | |||||
{% for action in global_actions %} | {% for action in global_actions %} | ||||
{{ include(action.templatePath, { action: action }, with_context = false) }} | {{ include(action.templatePath, { action: action }, with_context = false) }} | ||||
{% endfor %} | {% endfor %} | ||||
</div> | |||||
{% endblock global_actions %} | |||||
{% endblock global_actions %} | |||||
</div> | |||||
{% block batch_actions %} | {% block batch_actions %} | ||||
{% if has_batch_actions %} | {% if has_batch_actions %} | ||||
<div class="batch-actions" style="display: none"> | <div class="batch-actions" style="display: none"> |