Skip to content
Snippets Groups Projects
Commit cb1f01e4 authored by Jonathan Foucher's avatar Jonathan Foucher
Browse files

Update document category name via migration + show documents on AIPD list....

Update document category name via migration + show documents on AIPD list. Fixes #665
parent 9ce875d5
No related branches found
No related tags found
No related merge requests found
Pipeline #46887 failed
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
use DoctrineExtensions\Query\Mysql\Date;
use DoctrineExtensions\Query\Mysql\Now;
use Ramsey\Uuid\Uuid;
final class Version20230502000001 extends AbstractMigration
{
public function getDescription(): string
{
return 'Change document category name';
}
public function up(Schema $schema): void
{
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('UPDATE category SET name=? WHERE name="Conformité de l\'organisation"',["Conformité de la structure"]);
}
public function down(Schema $schema): void
{
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
}
}
......@@ -16,6 +16,7 @@ use App\Domain\AIPD\Model\AnalyseImpact;
use App\Domain\AIPD\Model\AnalyseScenarioMenace;
use App\Domain\AIPD\Model\CriterePrincipeFondamental;
use App\Domain\AIPD\Repository;
use App\Domain\Documentation\Model\Category;
use App\Domain\User\Model\Collectivity;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Tools\Pagination\Paginator;
......@@ -91,8 +92,12 @@ class AnalyseImpactController extends CRUDController
public function listAction(): Response
{
$category = $this->entityManager->getRepository(Category::class)->findOneBy([
'name' => 'AIPD',
]);
return $this->render($this->getTemplatingBasePath('list'), [
'totalItem' => $this->repository->count(),
'category' => $category,
'route' => $this->router->generate('aipd_analyse_impact_datatables'),
]);
}
......
......@@ -23,6 +23,18 @@
{% block body %}
<div class="row" style="margin-bottom: 1em">
<div class="col-xs-12">
<div class="action-bar" id="action-top-buttons">
{% if category and category.documents|length > 0 %}
<a href="{{ path('documentation_document_index') }}?category={{ category.id }}" class="btn btn-default pull-right">
<i class="far fa-file"></i>
{{ 'documentation.document.link.button'|trans }}
</a>
{% endif %}
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="box box-solid">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment