diff --git a/extensions/webmail/forms.py b/extensions/webmail/forms.py index 5826d6820..7cc3dfb2e 100644 --- a/extensions/webmail/forms.py +++ b/extensions/webmail/forms.py @@ -5,6 +5,7 @@ class ComposeMailForm(forms.Form): from_ = forms.CharField(label=_("From")) to = forms.CharField(label=_("To")) cc = forms.CharField(label=_("Cc"), required=False) + cci = forms.CharField(label=_("Cci"), required=False) subject = forms.CharField(label=_("Subject"), max_length=255, required=False) origmsgid = forms.CharField(label="", widget=forms.HiddenInput(), required=False) diff --git a/extensions/webmail/lib.py b/extensions/webmail/lib.py index b4abfa30a..9f2a552b4 100644 --- a/extensions/webmail/lib.py +++ b/extensions/webmail/lib.py @@ -601,6 +601,9 @@ def send_mail(request, posturl=None): body = request.POST["id_body"] charset = "utf-8" + + print body + if editormode == "html": msg = MIMEMultipart(_subtype="related") submsg = MIMEMultipart(_subtype="alternative") @@ -639,9 +642,10 @@ def send_mail(request, posturl=None): if form.cleaned_data.has_key("origmsgid"): msg["References"] = msg["In-Reply-To"] = form.cleaned_data["origmsgid"] rcpts = msg['To'].split(',') - if form.cleaned_data["cc"] != "": - msg["Cc"] = form.cleaned_data["cc"] - rcpts += msg["Cc"].split(",") + for hdr in ["cc", "cci"]: + if form.cleaned_data[hdr] != "": + msg[hdr.capitalize()] = form.cleaned_data[hdr] + rcpts += msg[hdr.capitalize()].split(",") try: secmode = parameters.get_admin("SMTP_SECURED_MODE") diff --git a/extensions/webmail/static/css/webmail.css b/extensions/webmail/static/css/webmail.css index 1e988e462..dd1748763 100644 --- a/extensions/webmail/static/css/webmail.css +++ b/extensions/webmail/static/css/webmail.css @@ -3,15 +3,6 @@ body, html { height: 100%; } -#leftcol { - /*position: fixed; - top: 60px; - left: 0; - width: 200px; - padding-left: 15px; - overflow: hidden;*/ -} - #folders { position: fixed; top: 60px; @@ -28,7 +19,9 @@ body, html { #menubar { position: fixed; left: 215px; + right: 0; padding-left: 15px; + padding-right: 15px; } #listing { @@ -120,6 +113,14 @@ div.expanded { text-align: left; } +#mailheader .options { + margin-left: 160px; +} + +#add_cc { + margin-right: 20px; +} + #attachments { position: relative; margin: 1px 0 5px 0; diff --git a/extensions/webmail/static/js/webmail.js b/extensions/webmail/static/js/webmail.js index 8306b0bfb..5e9dab972 100644 --- a/extensions/webmail/static/js/webmail.js +++ b/extensions/webmail/static/js/webmail.js @@ -675,13 +675,14 @@ Webmail.prototype = { sendmail: function(e) { var $link = $(e.target); var $form = $("#composemail"); - var args = $form.serialize(); e.preventDefault(); $link.attr("disabled", "disabled"); if (this.editormode == "html") { CKEDITOR.instances[this.editorid].updateElement(); } + var args = $form.serialize(); + $.ajax({ url: $form.attr("action"), data: args, @@ -696,6 +697,7 @@ Webmail.prototype = { */ viewmail_loader: function(e) { var $tr = $(e.target).parent(); + var curmb = this.get_current_mailbox(); e.preventDefault(); if ($tr.hasClass("unseen")) { @@ -704,6 +706,7 @@ Webmail.prototype = { } this.navobject.reset().setparams({ action: "viewmail", + mbox: curmb, mailid: $tr.attr("id") }).update(); }, @@ -745,8 +748,20 @@ Webmail.prototype = { $("#body_container").outerHeight(true)); }, + add_field: function(e, name) { + e.preventDefault(); + $("label[for=id_" + name + "]").parent().show(); + $(e.target).hide(); + this.position_body(); + if (this.editormode == "html") { + this.resize_editor(); + } + }, + compose_callback: function(resp) { this.page_update(resp); + $("#add_cc").click($.proxy(function(e) { this.add_field(e, "cc"); }, this)); + $("#add_cci").click($.proxy(function(e) { this.add_field(e, "cci"); }, this)); this.editormode = resp.editor; if (resp.editor == "html") { var instance = CKEDITOR.instances[this.editorid]; @@ -796,6 +811,13 @@ Webmail.prototype = { viewmail_callback: function(resp) { this.page_update(resp); $("#listing").css("overflow", "hidden"); + $("a[name=close]").click($.proxy(function(e) { + e.preventDefault(); + var curmb = this.get_current_mailbox(); + this.navobject.delparam("mailid") + .setparams({action: "listmailbox", name: curmb}) + .update(); + }, this)); }, mark_callback: function(data) { diff --git a/extensions/webmail/templates/webmail/compose.html b/extensions/webmail/templates/webmail/compose.html index 177cee21e..21cbbfad8 100644 --- a/extensions/webmail/templates/webmail/compose.html +++ b/extensions/webmail/templates/webmail/compose.html @@ -2,7 +2,14 @@