issue #0001914 : Surveillance email(s) du compte principal

This commit is contained in:
Michael RICOIS 2014-04-22 12:41:13 +00:00
parent 3ba1ed2a4b
commit dc9bbba661
3 changed files with 18 additions and 9 deletions

View File

@ -52,13 +52,18 @@ class SurveillanceController extends Zend_Controller_Action
$this->_helper->layout->disableLayout();
$request = $this->getRequest();
$siret = $request->getParam('siret', '');
$email = $request->getParam('email', '');
$ref = $request->getParam('ref', '');
$source = $request->getParam('source', '');
$encours = $request->getParam('encours', 0);
$user = new Scores_Utilisateur();
// Main email
$email = $user->getEmail();
$emails = explode(';', $email);
//Secondary email
//$ws = new WsScores();
//secondEmails = $ws->getEmail();
if( empty($source) ) {
$source = array();
@ -78,7 +83,8 @@ class SurveillanceController extends Zend_Controller_Action
}
$this->view->assign('source', $source);
$this->view->assign('siret', $siret);
$this->view->assign('email', $email);
$this->view->assign('emails', $emails);
$this->view->assign('email', join(';',$emails));
$this->view->assign('ref', $ref);
$this->view->assign('encours', $encours);
}
@ -119,9 +125,9 @@ class SurveillanceController extends Zend_Controller_Action
echo "Erreur lors de la suppression";
}
} elseif (isset($page)) {
$this->_redirect('surveillance/liste/page/'.$page);
$this->redirect('surveillance/liste/page/'.$page);
} else {
$this->_redirect('surveillance/liste');
$this->redirect('surveillance/liste');
}
}

View File

@ -72,7 +72,10 @@ $('#dialogsurv').dialog({ buttons: [ {
<div class="fieldgrp">
<label class="StyleInfoLib">Adresse email du destinataire</label>
<div class="field">
<input class="longfield" name="email" type="text" value="<?=$this->email?>" size="20"/>
<?php foreach($this->emails as $email) {?>
<?=$email?><br/>
<?php }?>
<input class="longfield" name="email" type="hidden" value="<?=$this->email?>"/>
</div>
</div>
@ -102,13 +105,13 @@ function survSubmit(){
source.push($('input[name=source]').val());
}
$('#frmSurv').replaceWith('<div id="frmSurv">Mise sous surveillance en cours...</div>');
if (source.length>0) {
$.each( source, function( key, value ) {
$.post(action, {siret: siret, ref: ref, email: email, encours: encours, source: value} ,
function(data) { $('#frmSurv').append('<br/>'+data);
}, 'text');
});
$('#frmSurv').append('<br/>Mise sous surveillance terminé.');
$('#dialogsurv').dialog({ buttons: [
{ text: "Fermer", click: function() { window.location.href = windowhref; } }
]});

View File

@ -8,7 +8,7 @@ $(document).ready(function(){
bgiframe: true,
title: title,
width: 500,
height: 350,
height: 400,
modal: true,
open: function(event, ui) {
$(this).html('Chargement...');