From b3cb970eefaf133b707f714c9bfee00929c3d088 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 22 Nov 2012 12:23:50 +0530 Subject: [PATCH] compose support ticket reply using markdown --- home/page/latest_updates/latest_updates.js | 5 ++++- support/doctype/support_ticket/support_ticket.py | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/home/page/latest_updates/latest_updates.js b/home/page/latest_updates/latest_updates.js index a99185cd42..dfd6c10e42 100644 --- a/home/page/latest_updates/latest_updates.js +++ b/home/page/latest_updates/latest_updates.js @@ -1,4 +1,7 @@ erpnext.updates = [ + ["22nd November 2012", [ + "Support Ticket: Compose a reply using Markdown", + ]], ["21st November 2012", [ "Tree Report: Added missing expand / collapse buttons.", "List View: Do not show restricted records, as defined in Permission Manager.", @@ -6,7 +9,7 @@ erpnext.updates = [ "Customer Link Field: Show only ID in auto-suggest \ if ID created using Customer Name (as defined in Global Defaults)", "Letter Head: Fixed bug causing cursor position to reset in Content", - ], + ]], ["20th November 2012", [ "Auto-suggest: Show main label in bold", "Data Import Tool: Fixed #Name error faced by MS Excel users in import template", diff --git a/support/doctype/support_ticket/support_ticket.py b/support/doctype/support_ticket/support_ticket.py index dde4fd2c7b..39686187b6 100644 --- a/support/doctype/support_ticket/support_ticket.py +++ b/support/doctype/support_ticket/support_ticket.py @@ -36,16 +36,19 @@ class DocType(TransactionBase): if not self.doc.new_response: webnotes.msgprint("Please write something as a response", raise_exception=1) + import markdown2 + self.doc.new_response = markdown2.markdown(self.doc.new_response) + subject = '[' + self.doc.name + '] ' + (self.doc.subject or 'No Subject Specified') - response = self.doc.new_response + '\n\n[Please do not change the subject while responding.]' + response = self.doc.new_response + '

[Please do not change the subject while responding.]

' # add last response to new response response += self.last_response() signature = webnotes.conn.get_value('Email Settings',None,'support_signature') if signature: - response += '\n\n' + signature + response += '

' + signature + '

' from webnotes.utils.email_lib import sendmail