Bladeren bron

Correctif mineur

feature/symfony6.1
Fab 2 jaren geleden
bovenliggende
commit
5aa3db8687
4 gewijzigde bestanden met toevoegingen van 29 en 13 verwijderingen
  1. +14
    -1
      Controller/AbstractAdminController.php
  2. +1
    -0
      Definition/ActionDefinition.php
  3. +8
    -8
      Resources/views/adminlte/block/navbar_header.html.twig
  4. +6
    -4
      Resources/views/adminlte/crud/index.html.twig

+ 14
- 1
Controller/AbstractAdminController.php Bestand weergeven

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)) {

+ 1
- 0
Definition/ActionDefinition.php Bestand weergeven

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';


} }

+ 8
- 8
Resources/views/adminlte/block/navbar_header.html.twig Bestand weergeven

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>

+ 6
- 4
Resources/views/adminlte/crud/index.html.twig Bestand weergeven





<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">

Laden…
Annuleren
Opslaan