sendmail form should now work as before tls-sprint
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Fri, 24 Apr 2009 09:20:52 +0200
branchtls-sprint
changeset 1467 972517be96dc
parent 1466 07a2d0c387ca
child 1468 500ca81a344a
sendmail form should now work as before
web/data/cubicweb.widgets.js
web/views/basecontrollers.py
web/views/massmailing.py
--- a/web/data/cubicweb.widgets.js	Fri Apr 24 09:06:56 2009 +0200
+++ b/web/data/cubicweb.widgets.js	Fri Apr 24 09:20:52 2009 +0200
@@ -222,8 +222,7 @@
 
     __init__ : function(wdgnode) {
 	this.variables = getNodeAttribute(wdgnode, 'cubicweb:variables').split(',');
-	this.options = {'name' : wdgnode.getAttribute('cubicweb:inputname'),
-			'id'   : wdgnode.getAttribute('cubicweb:inputid'),
+	this.options = {'name'   : wdgnode.getAttribute('cubicweb:inputid'),
 			'rows' : wdgnode.getAttribute('cubicweb:rows') || 40,
 			'cols' : wdgnode.getAttribute('cubicweb:cols') || 80
 		       };
--- a/web/views/basecontrollers.py	Fri Apr 24 09:06:56 2009 +0200
+++ b/web/views/basecontrollers.py	Fri Apr 24 09:20:52 2009 +0200
@@ -551,7 +551,7 @@
     def publish(self, rset=None):
         # XXX this allow anybody with access to an cubicweb application to use it as a mail relay
         body = self.req.form['mailbody']
-        subject = self.req.form['mailsubject']
+        subject = self.req.form['subject']
         for recipient in self.recipients():
             text = body % recipient.as_email_context()
             self.sendmail(recipient.get_email(), subject, text)
--- a/web/views/massmailing.py	Fri Apr 24 09:06:56 2009 +0200
+++ b/web/views/massmailing.py	Fri Apr 24 09:20:52 2009 +0200
@@ -42,7 +42,7 @@
     recipient = StringField(widget=CheckBox(), label=_('Recipients:'))
     subject = StringField(label=_('Subject:'))
     mailbody = StringField(widget=AjaxWidget(wdgtype='TemplateTextField',
-                                             inputid='mailarea'))
+                                             inputid='mailbody'))
     form_buttons = [ImgButton('sendbutton', "javascript: $('#sendmail').submit()",
                               _('send email'), 'SEND_EMAIL_ICON'),
                     ImgButton('cancelbutton', "javascript: history.back()",