From 8f5bac4eebad439d97ae61b6f2a95b4ab75d5826 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Sat, 1 Dec 2012 14:22:46 +0530 Subject: [PATCH] communication, send print in content, auto set, send me a copy --- public/js/wn/views/communication.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/public/js/wn/views/communication.js b/public/js/wn/views/communication.js index 1bc544ff58..1638e89bea 100644 --- a/public/js/wn/views/communication.js +++ b/public/js/wn/views/communication.js @@ -163,8 +163,10 @@ wn.views.CommunicationComposer = Class.extend({ var me = this; var fields = this.dialog.fields_dict; - if(this.attach_document_print) - $(fields.attach_document_print.input).attr("checked", "checked").click(); + if(this.attach_document_print) { + $(fields.send_me_a_copy.input).click(); + $(fields.attach_document_print.input).click(); + } $(fields.send_email.input).attr("checked", "checked") $(fields.add_reply.input).click(function() { @@ -176,8 +178,15 @@ wn.views.CommunicationComposer = Class.extend({ return $(element).attr("data-file-name"); }) - _p.build(form_values.select_print_format || "", function(print_html) { + _p.build(form_values.select_print_format || "", function(print_format_html) { me.dialog.hide(); + if(form_values.attach_document_print) { + var print_html = print_format_html + form_values.content = form_values.content + + "


" + print_html; + } else { + print_html = ""; + } wn.call({ method:"core.doctype.communication.communication.make", args: { @@ -191,8 +200,7 @@ wn.views.CommunicationComposer = Class.extend({ contact: me.doc.contact, send_me_a_copy: form_values.send_me_a_copy, send_email: form_values.send_email, - print_html: form_values.attach_document_print - ? print_html : "", + print_html: print_html, attachments: selected_attachments }, callback: function(r) {