Commit e8c5401c authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Merge branch 'upgrade-module-information' into develop

parents bf443bb7 18ea9717
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ return [
                        'telecharger',
                    ],
                    'privileges' => [
                        InformationPrivileges::INFORMATION_MODIFIER,
                        InformationPrivileges::INFORMATION_FICHIER,
                    ]
                ],
            ],
+1 −0
Original line number Diff line number Diff line
@@ -12,4 +12,5 @@ use UnicaenAuth\Provider\Privilege\Privileges;
class InformationPrivileges extends Privileges
{
    const INFORMATION_MODIFIER          = 'faq-modifier-information';
    const INFORMATION_FICHIER           = 'faq-modifier-fichier';
}
 No newline at end of file
+9 −1
Original line number Diff line number Diff line
@@ -3,8 +3,11 @@
/** @var InformationFichier[] $fichiers */

use Information\Entity\Db\InformationFichier;
use Information\Provider\Privilege\InformationPrivileges;

$this->headTitle("Fichiers associées aux pages d'information")
$this->headTitle("Fichiers associées aux pages d'information");

$canFichier = $this->isAllowed(InformationPrivileges::getResourceId(InformationPrivileges::INFORMATION_FICHIER));
?>

<style>
@@ -17,9 +20,12 @@ $this->headTitle("Fichiers associées aux pages d'information")
    Fichiers associées aux pages d'information
</h1>


<?php if ($canFichier) : ?>
    <h2> Téléversement d'un fichier </h2>

    <?php echo $this->form($form); ?>
<?php endif; ?>

<h2> Listing des fichiers téléversés pour le module informations </h2>

@@ -54,9 +60,11 @@ $this->headTitle("Fichiers associées aux pages d'information")
                    <?php echo $fichier->getDateCreation()->format("d/m/Y à H:i"); ?>
                </td>
                <td>
                    <?php if ($canFichier) : ?>
                        <a href="<?php echo $this->url("informations/fichiers/supprimer", ['id' => $fichier->getId()], [], true); ?>">
                            <span class="glyphicon glyphicon-remove"></span>
                        </a>
                    <?php endif; ?>
                </td>
            </tr>
        <?php endforeach; ?>
+6 −2
Original line number Diff line number Diff line
@@ -5,12 +5,14 @@
 */

use Information\Entity\Db\Information;
use Information\Provider\Privilege\InformationPrivileges;

$this->headTitle("Index des informations");

$canView    = true;
$canEdit    = true;
$canDelete  = true;
$canEdit    = $this->isAllowed(InformationPrivileges::getResourceId(InformationPrivileges::INFORMATION_MODIFIER));
$canDelete  = $this->isAllowed(InformationPrivileges::getResourceId(InformationPrivileges::INFORMATION_MODIFIER));
$canFichier = $this->isAllowed(InformationPrivileges::getResourceId(InformationPrivileges::INFORMATION_FICHIER));
?>

<style>
@@ -30,12 +32,14 @@ $canDelete = true;
    Ajouter une page d'information
</a>

<?php if ($canFichier) : ?>
    <a href="<?php echo $this->url('informations/fichiers', [], [], true); ?>"
       class="btn btn-primary action"
    >
        <span class="glyphicon glyphicon-folder-open "></span>
        Gestion des fichiers
    </a>
<?php endif; ?>

<table class="table table-extra-condensed">
    <thead>