From c9746cd0d95e00ca951449c7a155ce6f1c4de24c Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 19 Dec 2012 12:46:02 +0530 Subject: [PATCH] removed next_contact in quotation, fixed regex to convert relative links to absolute --- core/doctype/communication/communication.py | 2 +- public/js/legacy/widgets/form/print_format.js | 6 ++++-- public/js/wn/views/communication.js | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/doctype/communication/communication.py b/core/doctype/communication/communication.py index 529a59d049..7e0e3e66e0 100644 --- a/core/doctype/communication/communication.py +++ b/core/doctype/communication/communication.py @@ -106,7 +106,7 @@ def set_lead_and_contact(d): if not d.lead: d.lead = webnotes.conn.get_value("Lead", {"email_id": email_addr[1]}, "name") or None - if not d.lead and not d.contact: + if not (d.lead or d.contact): d.lead = make_lead(d, email_addr[0], email_addr[1]) def make_lead(d, real_name, email_id): diff --git a/public/js/legacy/widgets/form/print_format.js b/public/js/legacy/widgets/form/print_format.js index e8f36631de..451f707280 100644 --- a/public/js/legacy/widgets/form/print_format.js +++ b/public/js/legacy/widgets/form/print_format.js @@ -373,8 +373,10 @@ $.extend(_p, { // replace relative links by absolute links var prefix = window.location.href.split("app.html")[0] - $.each(finished.match(/src=['"]([^'"]*)['"]/) || [], function(i, v) { - if(v.substr(0,4)!="src=") { + $.each(finished.match(/src=['"]([^'"]*)['"]/g) || [], function(i, v) { + if(v.substr(0,4)=="src=") { + var v = v.substr(5, v.length-6); + console.log(v); if(v.substr(0,4)!="http") finished = finished.replace(v, prefix + v); } diff --git a/public/js/wn/views/communication.js b/public/js/wn/views/communication.js index dc7f7277a1..94f0fc00ca 100644 --- a/public/js/wn/views/communication.js +++ b/public/js/wn/views/communication.js @@ -108,7 +108,7 @@ wn.views.CommunicationComposer = Class.extend({ {label:"To", fieldtype:"Data", reqd: 1, fieldname:"recipients", description:"Email addresses, separted by commas"}, {label:"Subject", fieldtype:"Data", reqd: 1}, - {label:"Add Reply", fieldtype:"Button"}, + {label:"Send", fieldtype:"Button"}, {label:"Message", fieldtype:"Text Editor", reqd: 1, fieldname:"content"}, {label:"Send Email", fieldtype:"Check"}, {label:"Send Me A Copy", fieldtype:"Check"}, @@ -170,7 +170,7 @@ wn.views.CommunicationComposer = Class.extend({ } $(fields.send_email.input).attr("checked", "checked") - $(fields.add_reply.input).click(function() { + $(fields.send.input).click(function() { var form_values = me.dialog.get_values(); if(!form_values) return;