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

Ajout du lien + modification affichage redir

parent 2e6e9dd0
Loading
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@
namespace UnicaenMail\Controller;

use UnicaenMail\Service\Mail\MailServiceAwareTrait;
use UnicaenUtilisateur\Entity\Db\User;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;

@@ -37,7 +36,9 @@ class MailController extends AbstractActionController {
            if(!isset($data['mail-to']) || !filter_var($data['mail-to'], FILTER_VALIDATE_EMAIL)) {
                return ['title' => "Envoyer un mail de test", 'error' => "L'adresse mail saisie n'est pas valide."];
            }
            $this->getMailService()->sendMail($data['mail-to'], 'Mail de test', 'Ceci est un mail de test. <br/> <hr/>Merci de ne pas en tenir compte.');
            $mail = $this->getMailService()->sendMail($data['mail-to'], 'Mail de test', 'Ceci est un mail de test. <br/> <hr/>Merci de ne pas en tenir compte.');
            $mail->setMotsClefs(['TEST']);
            $this->getMailService()->update($mail);
        }
        return ['title' => "Envoyer un mail de test"];
    }
+2 −2
Original line number Diff line number Diff line
@@ -163,9 +163,9 @@ class Mail {
    }

    /**
     * @return string
     * @return string|null
     */
    public function getMotsClefs() : string
    public function getMotsClefs() : ?string
    {
        return $this->motsClefs;
    }
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
        <field name="dateEnvoi"             type="datetime"                   column="date_envoi"           nullable="false"/>
        <field name="statusEnvoi"           type="string"   length="256"      column="status_envoi"         nullable="false"  />
        <field name="destinataires"         type="string"   length="256"      column="destinataires"        nullable="false"  />
        <field name="destinatairesInitials" type="string"   length="256"      column="destinataires_initials" nullable="false"  />
        <field name="destinatairesInitials" type="string"   length="256"      column="destinataires_initials" nullable="true"  />
        <field name="sujet"                 type="string"   length="9999"     column="sujet"                nullable="true"  />
        <field name="corps"                 type="string"   length="9999"     column="corps"                nullable="true"  />
        <field name="motsClefs"             type="string"   length="9999"     column="mots_clefs"           nullable="true" />
+8 −5
Original line number Diff line number Diff line
@@ -12,19 +12,19 @@ use UnicaenMail\Provider\Privilege\MailPrivileges;

/** Droits pour les actions */
$canAfficher = false;
if (!isset($options['droits']) AND !isset($options['droits']['afficher'])) {
if (!isset($options['droits']) OR !isset($options['droits']['afficher'])) {
    $canAfficher = $this->isAllowed(MailPrivileges::getResourceId(MailPrivileges::MAIL_AFFICHER));
} else {
    $canAfficher = $options['droits']['afficher'];
}
$canReenvoyer = false;
if (!isset($options['droits']) AND !isset($options['droits']['reenvoyer'])) {
if (!isset($options['droits']) OR !isset($options['droits']['reenvoyer'])) {
    $canReenvoyer = $this->isAllowed(MailPrivileges::getResourceId(MailPrivileges::MAIL_REENVOI));
} else {
    $canReenvoyer = $options['droits']['reenvoyer'];
}
$canSupprimer = false;
if (!isset($options['droits']) AND !isset($options['droits']['supprimer'])) {
if (!isset($options['droits']) OR !isset($options['droits']['supprimer'])) {
    $canSupprimer = $this->isAllowed(MailPrivileges::getResourceId(MailPrivileges::MAIL_SUPPRIMER));
} else {
    $canSupprimer = $options['droits']['supprimer'];
@@ -40,7 +40,7 @@ if (!isset($options['droits']) AND !isset($options['droits']['supprimer'])) {
        <th> Statut </th>
        <th> Sujet </th>
        <th> Infos </th>
        <th style="width:7rem;"> Action </th>
        <th style="min-width:7rem;"> Action </th>
    </tr>
    </thead>
    <tbody>
@@ -48,7 +48,10 @@ if (!isset($options['droits']) AND !isset($options['droits']['supprimer'])) {
        <tr>
            <td> <?php echo $mail->getDestinataires(); ?>
                <?php if ($mail->isRedirection()) : ?>
                    <span class="badge redir">Intialement : <?php echo $mail->getDestinatairesInitials(); ?></span>
                    <?php $destinataires = explode(",",$mail->getDestinatairesInitials()); ?>
                    <?php foreach ($destinataires as $destinataire) : ?>
                        <span class="badge redir">Intialement : <?php echo $destinataire; ?></span>
                    <?php endforeach; ?>
                <?php endif; ?>
            </td>
            <td> <?php echo $mail->getDateEnvoi()->format('d/m/Y <br/> H:i'); ?> </td>
+2 −2
Original line number Diff line number Diff line
@@ -23,8 +23,8 @@ $canTest = $this->isAllowed(MailPrivileges::getResourceId(MailPrivileges::MAIL_A
    </span>
</h1>

<a href=""
   class="btn btn-primary action">
<a href="<?php echo $this->url('mail/test', [], [], true); ?>"
   class="btn btn-primary action ajax-modal" data-event="modification" >
    <span class="icon mail"></span>
    Envoi d'un mail de test
</a>