Merge branch 'staging-fixes' into staging-fixes

This commit is contained in:
Suraj Shetty 2018-11-26 22:14:33 +05:30 committed by GitHub
commit 08ec5da838
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 31 deletions

View file

@ -12,6 +12,9 @@ def execute():
for report_name in reports:
settings = frappe.db.get_value('Report', report_name, 'json')
if not settings:
continue
settings = frappe._dict(json.loads(settings))
# columns -> fields

View file

@ -614,19 +614,14 @@ frappe.views.CommunicationComposer = Class.extend({
},
setup_earlier_reply: function() {
var fields = this.dialog.fields_dict,
signature = frappe.boot.user.email_signature || "",
last_email = this.last_email;
if(!last_email) {
last_email = this.frm && this.frm.timeline.get_last_email(true);
}
let fields = this.dialog.fields_dict;
let signature = frappe.boot.user.email_signature || "";
if(!frappe.utils.is_html(signature)) {
signature = signature.replace(/\n/g, "<br>");
}
if(this.txt) {
if (this.txt) {
this.message = this.txt + (this.message ? ("<br><br>" + this.message) : "");
} else {
// saved draft in localStorage
@ -641,29 +636,8 @@ frappe.views.CommunicationComposer = Class.extend({
+ this.real_name + ",</p><!-- salutation-ends --><br>" + (this.message || "");
}
var reply = (this.message || "")
+ (signature ? ("<br>" + signature) : "");
var content = '';
var reply = (this.message || "") + (signature ? ("<br>" + signature) : "");
if(last_email) {
var last_email_content = last_email.original_comment || last_email.content;
last_email_content = last_email_content
.replace(/&lt;meta[\s\S]*meta&gt;/g, '') // remove <meta> tags
.replace(/&lt;style[\s\S]*&lt;\/style&gt;/g, ''); // // remove <style> tags
var communication_date = last_email.communication_date || last_email.creation;
content = '<div><br></div>'
+ reply
+ "<div data-comment='original-reply'></div>"
+ '<blockquote>' +
'<p>' + __("On {0}, {1} wrote:",
[frappe.datetime.global_date_format(communication_date) , last_email.sender]) + '</p>' +
last_email_content +
'<blockquote>';
} else {
content = "<div><br></div>" + reply;
}
fields.content.set_value(content);
fields.content.set_value(reply);
}
});