From 61ade3d486f86db301166760746592ec6701dc6a Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 13 Jun 2012 12:53:03 +0530 Subject: [PATCH] auto populate To email field in email_doc if the current form has a value in the field contact_email --- public/js/all-app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/js/all-app.js b/public/js/all-app.js index cd14e76cea..d0bc4b9ce7 100644 --- a/public/js/all-app.js +++ b/public/js/all-app.js @@ -1729,7 +1729,8 @@ if(this.meta.default_print_format) this.default_format=this.meta.default_print_format;l.push('Standard');this.print_sel=$a(null,'select','',{width:'160px'});add_sel_options(this.print_sel,l);this.print_sel.value=this.default_format;} _f.Frm.prototype.print_doc=function(){if(this.doc.docstatus==2){msgprint("Cannot Print Cancelled Documents.");return;} _p.show_dialog();} -_f.Frm.prototype.email_doc=function(){if(!_e.dialog)_e.make();sel=this.print_sel;var c=$td(_e.dialog.rows['Format'].tab,0,1);if(c.cur_sel){c.removeChild(c.cur_sel);c.cur_sel=null;} +_f.Frm.prototype.email_doc=function(){if(!_e.dialog)_e.make();_e.dialog.widgets['To'].value='';if(cur_frm.doc&&cur_frm.doc.contact_email){_e.dialog.widgets['To'].value=cur_frm.doc.contact_email;} +sel=this.print_sel;var c=$td(_e.dialog.rows['Format'].tab,0,1);if(c.cur_sel){c.removeChild(c.cur_sel);c.cur_sel=null;} c.appendChild(this.print_sel);c.cur_sel=this.print_sel;_e.dialog.widgets['Send With Attachments'].checked=0;if(cur_frm.doc.file_list){$ds(_e.dialog.rows['Send With Attachments']);}else{$dh(_e.dialog.rows['Send With Attachments']);} _e.dialog.widgets['Subject'].value=get_doctype_label(this.meta.name)+': '+this.docname;_e.dialog.show();} _f.Frm.prototype.rename_notify=function(dt,old,name){if(this.meta.in_dialog)