From cee2b8ff4dfd462f2468f77a0bb810c4b86d1a8b Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 28 Nov 2012 10:47:51 +0530 Subject: [PATCH] support ticket: updated signature, doctype: create py if not exists --- public/js/communication.js | 26 ++++++++++++++----- .../doctype/support_ticket/support_ticket.txt | 16 ++++++++++-- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/public/js/communication.js b/public/js/communication.js index ca316cf803..70a08affec 100644 --- a/public/js/communication.js +++ b/public/js/communication.js @@ -20,6 +20,10 @@ erpnext.CommunicationView = Class.extend({ this.comm_list = []; $.extend(this, opts); + if(this.doc.__islocal) { + return; + } + this.list.sort(function(a, b) { return (new Date(a.modified) > new Date(b.modified)) ? -1 : 1; }) @@ -69,14 +73,15 @@ erpnext.CommunicationView = Class.extend({ {label:"Subject", fieldtype:"Data", reqd: 1}, {label:"Message", fieldtype:"Text Editor", reqd: 1, fieldname:"content"}, {label:"Send Email", fieldtype:"Check"}, - {label:"Send", fieldtype:"Button"}, + {label:"Add Reply", fieldtype:"Button"}, ] }); $(d.fields_dict.send_email.input).attr("checked", "checked") - $(d.fields_dict.send.input).click(function() { + $(d.fields_dict.add_reply.input).click(function() { var args = d.get_values(); if(!args) return; + $(this).set_working(); wn.call({ method:"support.doctype.communication.communication.make", args: $.extend(args, { @@ -93,8 +98,15 @@ erpnext.CommunicationView = Class.extend({ }); }); - d.fields_dict.content.input.set_input("

=== In response to ===

" - + me.list[0].content) + if(me.list.length > 0) { + d.fields_dict.content.input.set_input("

" + + (wn.boot.profile.email_signature || "") + +"

" + +"-----In response to-----

" + + me.list[0].content) + } else { + + } $(d.fields_dict.subject.input).val(this.doc.subject || "").change(); d.show(); @@ -108,7 +120,7 @@ erpnext.CommunicationView = Class.extend({ } if(!doc.sender) doc.sender = "[unknown sender]"; doc.sender = doc.sender.replace(//, ">"); - doc.content = doc.content.split("=== In response to ===")[0]; + doc.content = doc.content.split("-----In response to-----")[0]; doc.content = doc.content.split("-----Original Message-----")[0]; }, make_line: function(doc) { @@ -117,8 +129,8 @@ erpnext.CommunicationView = Class.extend({

%(sender)s on %(when)s \ \ Show Details

\ -
\ + \ ', doc)) .appendTo(this.body) .css({"cursor":"pointer"}) diff --git a/support/doctype/support_ticket/support_ticket.txt b/support/doctype/support_ticket/support_ticket.txt index 3878d27ebd..fc0c575657 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-27 18:21:06" + "modified": "2012-11-28 10:45:19" }, { "autoname": "naming_series:", @@ -69,11 +69,17 @@ "doctype": "DocField", "label": "Subject", "fieldname": "subject", - "fieldtype": "Text", + "fieldtype": "Data", "reqd": 1, "permlevel": 0, "in_filter": 1 }, + { + "doctype": "DocField", + "fieldname": "cb00", + "fieldtype": "Column Break", + "permlevel": 0 + }, { "oldfieldtype": "Data", "doctype": "DocField", @@ -86,6 +92,12 @@ "permlevel": 0, "in_filter": 1 }, + { + "doctype": "DocField", + "fieldname": "sb00", + "fieldtype": "Section Break", + "permlevel": 0 + }, { "oldfieldtype": "Text", "doctype": "DocField",