From cb60ca13a9cb98f6ce16e010543e95db498009b3 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 16 Jan 2012 11:58:14 +0530 Subject: [PATCH 1/2] added patch to convert tables to utf8 --- .../patches/jan_mar_2012/convert_tables_to_utf8.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 erpnext/patches/jan_mar_2012/convert_tables_to_utf8.py diff --git a/erpnext/patches/jan_mar_2012/convert_tables_to_utf8.py b/erpnext/patches/jan_mar_2012/convert_tables_to_utf8.py new file mode 100644 index 0000000000..1ae94a7dcd --- /dev/null +++ b/erpnext/patches/jan_mar_2012/convert_tables_to_utf8.py @@ -0,0 +1,11 @@ +import webnotes + +def execute(): + sql = webnotes.conn.sql + + sql("commit") + sql("set foreign_key_checks=0") + for tab in sql("show tables"): + sql("ALTER TABLE `%s` CONVERT TO CHARACTER SET utf8" % tab[0]) + + sql("set foreign_key_checks=1") From b3672784be602e7d2c0eec3534229787eea53bd9 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 16 Jan 2012 14:27:43 +0530 Subject: [PATCH 2/2] support ticket goes with response --- .../support/doctype/support_ticket/support_ticket.py | 11 +++++++++++ index.html | 2 +- version.num | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/erpnext/support/doctype/support_ticket/support_ticket.py b/erpnext/support/doctype/support_ticket/support_ticket.py index 709c7638a5..2db784eb3d 100644 --- a/erpnext/support/doctype/support_ticket/support_ticket.py +++ b/erpnext/support/doctype/support_ticket/support_ticket.py @@ -23,6 +23,9 @@ class DocType(TransactionBase): response = self.doc.new_response + '\n\n[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 @@ -39,6 +42,14 @@ class DocType(TransactionBase): webnotes.conn.set(self.doc,'status','Waiting for Customer') self.make_response_record(response) + def last_response(self): + """return last response""" + tmp = webnotes.conn.sql("""select mail from `tabSupport Ticket Response` + where parent = %s order by creation desc limit 1 + """, self.doc.name) + + return '\n\n=== In response to ===\n\n' + tmp[0][0] + def make_response_record(self, response, from_email = None, content_type='text/plain'): """ Creates a new Support Ticket Response record diff --git a/index.html b/index.html index 5e7bc59a13..ce1a617c21 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ ERPNext -