moving support ticket response to communication (wip)
This commit is contained in:
parent
7d665818b5
commit
17db39dc94
@ -86,8 +86,8 @@ $.extend(cur_frm.cscript, {
|
|||||||
parent: $a(cur_frm.fields_dict['thread_html'].wrapper, 'div'),
|
parent: $a(cur_frm.fields_dict['thread_html'].wrapper, 'div'),
|
||||||
no_result_message: 'No responses yet',
|
no_result_message: 'No responses yet',
|
||||||
get_query: function() {
|
get_query: function() {
|
||||||
return 'select mail, from_email, creation, content_type '+
|
return 'select content, email_address, creation '+
|
||||||
'from `tabSupport Ticket Response` where parent="'+doc.name+'" order by creation asc'
|
'from `tabCommunication` where support_ticket="'+doc.name+'" order by creation asc'
|
||||||
},
|
},
|
||||||
as_dict: 1,
|
as_dict: 1,
|
||||||
render_row: function(parent, data, list, idx) {
|
render_row: function(parent, data, list, idx) {
|
||||||
|
@ -64,8 +64,8 @@ class DocType(TransactionBase):
|
|||||||
|
|
||||||
def last_response(self):
|
def last_response(self):
|
||||||
"""return last response"""
|
"""return last response"""
|
||||||
tmp = webnotes.conn.sql("""select mail from `tabSupport Ticket Response`
|
tmp = webnotes.conn.sql("""select mail from `tabCommunication`
|
||||||
where parent = %s order by creation desc limit 1
|
where support_ticket = %s order by creation desc limit 1
|
||||||
""", self.doc.name)
|
""", self.doc.name)
|
||||||
|
|
||||||
if not tmp:
|
if not tmp:
|
||||||
@ -84,17 +84,17 @@ class DocType(TransactionBase):
|
|||||||
|
|
||||||
def make_response_record(self, response, from_email = None, content_type='text/plain'):
|
def make_response_record(self, response, from_email = None, content_type='text/plain'):
|
||||||
"""
|
"""
|
||||||
Creates a new Support Ticket Response record
|
Creates a new Communication record
|
||||||
"""
|
"""
|
||||||
# add to Support Ticket Response
|
# add to Communication
|
||||||
from webnotes.model.doc import Document
|
from webnotes.model.doc import Document
|
||||||
d = Document('Support Ticket Response')
|
d = Document('Communication')
|
||||||
d.from_email = from_email or webnotes.user.name
|
d.naming_series = "COMM-"
|
||||||
d.parent = self.doc.name
|
d.subject = self.doc.subject
|
||||||
d.parenttype = "Support Ticket"
|
d.email_address = from_email or webnotes.user.name
|
||||||
d.parentfield = "responses"
|
d.support_ticket = self.doc.name
|
||||||
d.mail = response
|
d.content = response
|
||||||
d.content_type = content_type
|
d.communication_medium = "Email"
|
||||||
d.save(1)
|
d.save(1)
|
||||||
|
|
||||||
def close_ticket(self):
|
def close_ticket(self):
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<button class="btn btn-small" onclick="erpnext.calendar.refresh('Month')">
|
<button class="btn btn-small" onclick="erpnext.calendar.refresh('Month')">
|
||||||
Month View
|
Month View
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-small" onclick="erpnext.calendar.refresh()">
|
<button class="btn btn-small" onclick="erpnext.calendar.refresh(null, true)">
|
||||||
<i class="icon-refresh"></i> Refresh
|
<i class="icon-refresh"></i> Refresh
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -241,9 +241,19 @@ Calendar.prototype.set_event = function(ev) {
|
|||||||
|
|
||||||
//------------------------------------------------------
|
//------------------------------------------------------
|
||||||
|
|
||||||
Calendar.prototype.refresh = function(viewtype){//Sets the viewtype of the Calendar and Calls the View class based on the viewtype
|
Calendar.prototype.clear = function() {
|
||||||
|
this.events = {};
|
||||||
|
this.events_by_name = {};
|
||||||
|
locals.Event = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
Calendar.prototype.refresh = function(viewtype, clear_events){//Sets the viewtype of the Calendar and Calls the View class based on the viewtype
|
||||||
if(viewtype)
|
if(viewtype)
|
||||||
this.viewtype = viewtype;
|
this.viewtype = viewtype;
|
||||||
|
|
||||||
|
if(clear_events)
|
||||||
|
this.clear();
|
||||||
|
|
||||||
// switch view if reqd
|
// switch view if reqd
|
||||||
if(this.cur_view.viewtype!=this.viewtype) {
|
if(this.cur_view.viewtype!=this.viewtype) {
|
||||||
this.cur_view.hide();
|
this.cur_view.hide();
|
||||||
@ -252,6 +262,7 @@ Calendar.prototype.refresh = function(viewtype){//Sets the viewtype of the Calen
|
|||||||
this.cur_view.show();
|
this.cur_view.show();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
this.cur_view.get_events();
|
||||||
this.cur_view.refresh(this);
|
this.cur_view.refresh(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user