Skip to content
Snippets Groups Projects
Commit 2df1fd84 authored by efalcy's avatar efalcy
Browse files

hotline #49590 : factorise alert message when click on send newsletter

parent eb147b1e
Branches
Tags
2 merge requests!1896Master,!1871Hotline#49590 pas de confirmation d envoi de nl
......@@ -44,7 +44,23 @@ class Admin_NewsletterController extends ZendAfi_Controller_Action {
return $this->view->tag('span', $this->view->boutonIco("picto=users", "bulle=" . $this->_('Inscrits')) . $model->getNumberOfUsers(), ['style' => 'white-space:nowrap']);
}],
['action' => 'sendtest', 'content' => $this->view->boutonIco('type=test')],
['action' => 'send', 'content' => $this->view->boutonIco('type=mail')],
['action' => 'send',
'content' => function($model) {
Class_ScriptLoader::getInstance()->addJQueryReady("
function sendNewsletterClick(event) {
var target = $(event.target).closest('a');
var answer = confirm(\"".$this->_("Envoyer la lettre d'information ?")."\");
if (answer == false) {
event.preventDefault();
return;
}
}
$(\"a[rel='send']\").click(sendNewsletterClick);
");
return $this->view->boutonIco('type=mail');}],
['action' => 'duplicate', 'content' => $this->view->boutonIco('type=duplicate')],
['action' => 'delete', 'content' => $this->view->boutonIco('type=del')],
],
......
......@@ -15,18 +15,3 @@ echo $this->tagModelTable($this->newsletters,
if (isset($this->subview))
echo $this->tag('div', $this->subview, ['class' => 'subview']);
?>
<script type="text/javascript">
function sendNewsletterClick(event) {
var target = $(event.target).closest('a');
var answer = confirm("<?php echo $this->_("Envoyer la lettre d'information ?"); ?>");
if (answer == false) {
event.preventDefault();
return;
}
}
$(document).ready(function() {
$("a[rel='send']").click(sendNewsletterClick);
});
</script>
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment