diff --git a/home/page/latest_updates/latest_updates.js b/home/page/latest_updates/latest_updates.js
index 41e8ecd499..9ba2015ce5 100644
--- a/home/page/latest_updates/latest_updates.js
+++ b/home/page/latest_updates/latest_updates.js
@@ -1,4 +1,8 @@
erpnext.updates = [
+ ["26th November 2012", [
+ "Email: Added User Signature",
+ "Support Ticket: Added link to Lead / Contact. If incoming ticket is not from an existing Lead / Contact, create a new Lead",
+ ]],
["24ht November 2012", [
"Support Ticket: Support Ticket Response is now Communication",
]],
diff --git a/home/page/profile_settings/profile_settings.js b/home/page/profile_settings/profile_settings.js
index 478af83ff6..795acb2e6b 100644
--- a/home/page/profile_settings/profile_settings.js
+++ b/home/page/profile_settings/profile_settings.js
@@ -70,6 +70,8 @@ MyProfile = function(wrapper) {
fields: [
{fieldname:'first_name', fieldtype:'Data',label:'First Name',reqd:1},
{fieldname:'last_name', fieldtype:'Data',label:'Last Name'},
+ {fieldname:'email_signature', fieldtype:'Text',label:'Email Signature',
+ decription:'Will be appended to outgoing mail'},
{fieldname:'bio', fieldtype:'Text',label:'Bio'},
{fieldname:'update', fieldtype:'Button',label:'Update'}
]
diff --git a/home/page/profile_settings/profile_settings.py b/home/page/profile_settings/profile_settings.py
index 8893ff6a62..0dbd10d891 100644
--- a/home/page/profile_settings/profile_settings.py
+++ b/home/page/profile_settings/profile_settings.py
@@ -63,6 +63,7 @@ def set_user_details(arg=None):
arg_dict = load_json(arg)
if not 'bio' in arg_dict: arg_dict['bio'] = None
if not 'last_name' in arg_dict: arg_dict['last_name'] = None
+ if not 'email_signature' in arg_dict: arg_dict['email_signature'] = None
p.fields.update(arg_dict)
p.save()
webnotes.msgprint('Updated')
diff --git a/public/js/toolbar.js b/public/js/toolbar.js
index 17f79dc589..1357eff950 100644
--- a/public/js/toolbar.js
+++ b/public/js/toolbar.js
@@ -22,7 +22,7 @@ erpnext.toolbar.setup = function() {
erpnext.toolbar.add_modules();
// profile
- $('#toolbar-user').append('
Profile Settings');
+ $('#toolbar-user').append('My Settings...');
$('.navbar .pull-right').append('\
');
diff --git a/support/doctype/communication/communication.txt b/support/doctype/communication/communication.txt
index 09f83bb3c1..ea457550a7 100644
--- a/support/doctype/communication/communication.txt
+++ b/support/doctype/communication/communication.txt
@@ -4,7 +4,7 @@
"docstatus": 0,
"creation": "2012-11-14 12:25:16",
"modified_by": "Administrator",
- "modified": "2012-11-26 11:17:28"
+ "modified": "2012-11-26 12:41:59"
},
{
"autoname": "naming_series:",
@@ -12,7 +12,7 @@
"name": "__common__",
"doctype": "DocType",
"module": "Support",
- "in_dialog": 1,
+ "in_dialog": 0,
"document_type": "Master",
"description": "Keep a track of all communications"
},
diff --git a/support/doctype/support_ticket/support_ticket.py b/support/doctype/support_ticket/support_ticket.py
index 43c650803b..13bc888509 100644
--- a/support/doctype/support_ticket/support_ticket.py
+++ b/support/doctype/support_ticket/support_ticket.py
@@ -100,28 +100,45 @@ class DocType(TransactionBase):
Creates a new Communication record
"""
# add to Communication
- import email.utils
-
d = webnotes.doc('Communication')
d.subject = self.doc.subject
d.email_address = from_email or webnotes.user.name
- email_addr = email.utils.parseaddr(d.email_address)[1]
- d.contact = webnotes.conn.get_value("Contact", {"email_id": email_addr}, "name") or None
- d.lead = webnotes.conn.get_value("Lead", {"email_id": email_addr}, "name") or None
+ self.set_lead_and_contact(d)
d.support_ticket = self.doc.name
d.content = response
d.communication_medium = "Email"
d.save(1)
-
- if not d.lead and not d.contact:
- self.make_lead(d, email_addr[0])
+ def set_lead_and_contact(self, d):
+ import email.utils
+ email_addr = email.utils.parseaddr(d.email_address)
+ # set contact
+ if self.doc.contact:
+ d.contact = self.doc.contact
+ else:
+ d.contact = webnotes.conn.get_value("Contact", {"email_id": email_addr[1]}, "name") or None
+ if d.contact:
+ webnotes.conn.set(self.doc, "contact", d.contact)
+
+ if self.doc.lead:
+ d.lead = self.doc.lead
+ else:
+ d.lead = webnotes.conn.get_value("Lead", {"email_id": email_addr[1]}, "name") or None
+ if d.lead:
+ webnotes.conn.set(self.doc, "lead", d.lead)
+
+ # not linked to any lead / contact, create new lead
+ if not d.lead and not d.contact:
+ d.lead = self.make_lead(d, email_addr[0])
+ webnotes.conn.set(self.doc, "lead", d.lead)
+
def make_lead(self, d, real_name):
d = webnotes.doc("Lead")
d.lead_name = real_name or d.email_address
d.email_id = d.email_address
d.source = "Email"
d.save(1)
+ return d.name
def close_ticket(self):
webnotes.conn.set(self.doc,'status','Closed')
diff --git a/support/doctype/support_ticket/support_ticket.txt b/support/doctype/support_ticket/support_ticket.txt
index c820bc61d7..8259954b14 100644
--- a/support/doctype/support_ticket/support_ticket.txt
+++ b/support/doctype/support_ticket/support_ticket.txt
@@ -4,7 +4,7 @@
"docstatus": 0,
"creation": "2012-11-02 17:17:05",
"modified_by": "Administrator",
- "modified": "2012-11-26 11:17:10"
+ "modified": "2012-11-26 12:54:25"
},
{
"autoname": "naming_series:",
@@ -138,6 +138,22 @@
"depends_on": "eval:!doc.__islocal",
"permlevel": 1
},
+ {
+ "doctype": "DocField",
+ "label": "Lead",
+ "options": "Lead",
+ "fieldname": "lead",
+ "fieldtype": "Link",
+ "permlevel": 0
+ },
+ {
+ "doctype": "DocField",
+ "label": "Contact",
+ "options": "Contact",
+ "fieldname": "contact",
+ "fieldtype": "Link",
+ "permlevel": 0
+ },
{
"print_hide": 1,
"oldfieldtype": "Link",
@@ -166,36 +182,6 @@
"permlevel": 2,
"in_filter": 1
},
- {
- "doctype": "DocField",
- "label": "Address",
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "permlevel": 2
- },
- {
- "doctype": "DocField",
- "label": "Contact Name",
- "fieldname": "contact_display",
- "fieldtype": "Data",
- "permlevel": 2
- },
- {
- "doctype": "DocField",
- "label": "Mobile No",
- "fieldname": "contact_mobile",
- "fieldtype": "Data",
- "permlevel": 2
- },
- {
- "oldfieldtype": "Data",
- "doctype": "DocField",
- "label": "Contact Email",
- "oldfieldname": "contact_no",
- "fieldname": "contact_email",
- "fieldtype": "Data",
- "permlevel": 2
- },
{
"default": "Today",
"oldfieldtype": "Date",
@@ -225,20 +211,6 @@
"depends_on": "eval:!doc.__islocal",
"permlevel": 1
},
- {
- "depends_on": "eval:!doc.__islocal",
- "search_index": 1,
- "colour": "White:FFF",
- "doctype": "DocField",
- "label": "Allocated To",
- "oldfieldname": "allocated_to",
- "permlevel": 1,
- "fieldname": "allocated_to",
- "fieldtype": "Link",
- "oldfieldtype": "Link",
- "options": "Profile",
- "in_filter": 1
- },
{
"no_copy": 1,
"oldfieldtype": "Text",
@@ -246,7 +218,7 @@
"label": "Resolution Details",
"oldfieldname": "resolution_details",
"fieldname": "resolution_details",
- "fieldtype": "Text",
+ "fieldtype": "Small Text",
"depends_on": "eval:!doc.__islocal",
"permlevel": 1
},