Commit 0e24fc15 authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Ajout d'un champs cci pour l'envoi de mail pour les notes et les refus de pièces jointes (#45083)

parent 6d3fd538
Loading
Loading
Loading
Loading
+2 −21
Original line number Diff line number Diff line
@@ -64,7 +64,6 @@ class PieceJointeController extends AbstractController
    }



    /**
     *
     * @return ViewModel
@@ -106,7 +105,6 @@ class PieceJointeController extends AbstractController
    }



    /**
     *
     * @return ViewModel
@@ -127,7 +125,6 @@ class PieceJointeController extends AbstractController
    }



    /**
     * @param TblPieceJointeDemande[] $demandees
     * @param TblPieceJointeFournie[] $fournies
@@ -175,7 +172,6 @@ class PieceJointeController extends AbstractController
    }



    public function validationAction()
    {
        $this->initFilters();
@@ -188,7 +184,6 @@ class PieceJointeController extends AbstractController
    }



    public function validerAction()
    {
        $this->initFilters();
@@ -206,7 +201,6 @@ class PieceJointeController extends AbstractController
    }



    public function archiverAction()
    {
        $this->initFilters();
@@ -228,7 +222,6 @@ class PieceJointeController extends AbstractController
    }



    public function devaliderAction()
    {
        $this->initFilters();
@@ -246,7 +239,6 @@ class PieceJointeController extends AbstractController
    }



    public function listerAction()
    {
        $this->initFilters();
@@ -267,7 +259,6 @@ class PieceJointeController extends AbstractController
    }



    public function televerserAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -291,7 +282,6 @@ class PieceJointeController extends AbstractController
    }



    public function telechargerAction()
    {
        /** @var Fichier $fichier */
@@ -312,7 +302,6 @@ class PieceJointeController extends AbstractController
    }



    public function supprimerAction()
    {
        if (!$this->getRequest()->isPost()) {
@@ -339,7 +328,6 @@ class PieceJointeController extends AbstractController
    }



    /* Actions liées à la configuration des PJ */

    public function configurationAction()
@@ -348,7 +336,6 @@ class PieceJointeController extends AbstractController
    }



    public function typePieceJointeStatutAction()
    {
        $codeIntervenant = $this->params()->fromRoute('codeTypeIntervenant', TypeIntervenant::CODE_EXTERIEUR);
@@ -404,7 +391,6 @@ class PieceJointeController extends AbstractController
    }



    public function typePieceJointeDeleteAction()
    {
        $typePieceJointe = $this->getEvent()->getParam('typePieceJointe');
@@ -420,7 +406,6 @@ class PieceJointeController extends AbstractController
    }



    public function typePieceJointeSaisieAction()
    {
        /* @var $typePieceJointe TypePieceJointe */
@@ -440,7 +425,6 @@ class PieceJointeController extends AbstractController
    }



    public function modifierTypePieceJointeStatutAction()
    {
        /* @var $tpjs TypePieceJointeStatut */
@@ -466,7 +450,6 @@ class PieceJointeController extends AbstractController
    }



    public function typePieceJointeTrierAction()
    {
        /* @var $tpj TypePieceJointe */
@@ -492,7 +475,6 @@ class PieceJointeController extends AbstractController
    }



    public function deleteTypePieceJointeStatutAction()
    {
        $typePieceJointeStatut = $this->getEvent()->getParam('typePieceJointeStatut');
@@ -508,7 +490,6 @@ class PieceJointeController extends AbstractController
    }



    private function updateTableauxBord(Intervenant $intervenant, $validation = false)
    {
        $this->getServiceWorkflow()->calculerTableauxBord([
@@ -529,7 +510,6 @@ class PieceJointeController extends AbstractController
    }



    public function refuserAction()
    {
        /** @var PieceJointe $pj */
@@ -553,7 +533,8 @@ class PieceJointeController extends AbstractController
                $to = $data['to'];
                $subject = $data['subject'];
                $content = $data['content'];
                $this->getServiceMail()->envoyerMail($from, $to, $subject, $content);
                $copy = $data['copy'];
                $this->getServiceMail()->envoyerMail($from, $to, $subject, $content, $copy);
                //Création d'une trace de l'envoi dans les notes de l'intervenant
                $this->getServiceNote()->createNoteFromEmail($pj->getIntervenant(), $subject, $content);
                $this->flashMessenger()->addSuccessMessage('Email envoyé à l\'intervenant');
+2 −2
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ echo $this->form()->openTag($form);

echo $this->formControlGroup($form->get('from'));
echo $this->formControlGroup($form->get('to'));
echo $this->formControlGroup($form->get('copy'));
echo $this->formControlGroup($form->get('subject'));
echo $this->formControlGroup($form->get('content'));
echo $this->formRow($form->get('submit'));
@@ -43,8 +44,7 @@ echo $this->form()->closeTag();
     * @param {string} selector
     * @param {object} form
     */
    function installEditor(selector, form)
    {
    function installEditor(selector, form) {
        WidgetInitializer.includeJs(Url('vendor/tinymce-4.4.1/js/tinymce/tinymce.min.js'));
        tinymce.editors = [];
        tinymce.init({
+2 −5
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@ class NoteController extends AbstractController
    }



    public function saisirAction()
    {

@@ -83,7 +82,6 @@ class NoteController extends AbstractController
    }



    public function voirAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -95,7 +93,6 @@ class NoteController extends AbstractController
    }



    public function supprimerAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -119,7 +116,6 @@ class NoteController extends AbstractController
    }



    public function envoyerEmailAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -134,7 +130,8 @@ class NoteController extends AbstractController
                $to = $data['to'];
                $subject = $data['subject'];
                $content = $data['content'];
                $this->getServiceMail()->envoyerMail($from, $to, $subject, $content);
                $copy = $data['copy'];
                $this->getServiceMail()->envoyerMail($from, $to, $subject, $content, $copy);
                //Création d'une trace de l'envoi dans les notes de l'intervenant
                $this->getServiceNote()->createNoteFromEmail($intervenant, $subject, $content);
                $this->flashMessenger()->addSuccessMessage('Email envoyé à l\'intervenant');
+6 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ class MailerIntervenantForm extends AbstractForm
            'subject' => 'Objet du mail',
            'to'      => 'Email intervenant',
            'content' => 'Contenu du mail',
            'copy'    => 'Email en copie caché',

        ];

@@ -56,6 +57,11 @@ class MailerIntervenantForm extends AbstractForm
                'type' => 'Text',
                'name' => 'from',

            ],
            'copy'    => [
                'type' => 'Text',
                'name' => 'copy',

            ],
            'to'      => [
                'type' => 'Select',
+2 −5
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@ class MailService extends AbstractService
    private Mail $mail;



    /**
     * @return Mail
     */
@@ -43,7 +42,6 @@ class MailService extends AbstractService
    }



    /**
     * @param Mail $mail
     */
@@ -53,14 +51,12 @@ class MailService extends AbstractService
    }



    public function __construct(Mail $mail)
    {
        $this->mail = $mail;
    }



    /**
     *
     * @param string $from
@@ -70,7 +66,7 @@ class MailService extends AbstractService
     *
     * @return void
     */
    public function envoyerMail(string $from, string $to, string $subject, string $content)
    public function envoyerMail(string $from, string $to, string $subject, string $content, string $copy)
    {

        $body = new Message();
@@ -85,6 +81,7 @@ class MailService extends AbstractService
            ->setFrom($from)
            ->setSubject($subject)
            ->addTo($to)
            ->addBcc($copy)
            ->setBody($body);

        //Envoi du mail
Loading