fixes to support ticket
This commit is contained in:
parent
e7eacb7c41
commit
a1c232ac16
@ -1,6 +1,7 @@
|
|||||||
import webnotes
|
import webnotes
|
||||||
sql = webnotes.conn.sql
|
sql = webnotes.conn.sql
|
||||||
|
|
||||||
|
from webnotes.utils import cint, cstr
|
||||||
|
|
||||||
class DocType:
|
class DocType:
|
||||||
def __init__(self,doc,doclist):
|
def __init__(self,doc,doclist):
|
||||||
@ -26,10 +27,14 @@ class DocType:
|
|||||||
Sets or cancels the event in the scheduler
|
Sets or cancels the event in the scheduler
|
||||||
"""
|
"""
|
||||||
# update control panel
|
# update control panel
|
||||||
map(self.set_cp_value, 'outgoing_mail_server', 'mail_login', 'mail_password', 'auto_email_id', 'mail_port', 'use_ssl')
|
for f in ('outgoing_mail_server', 'mail_login', 'mail_password', 'auto_email_id', 'mail_port', 'use_ssl'):
|
||||||
|
self.set_cp_value(f)
|
||||||
|
|
||||||
# setup scheduler for support emails
|
# setup scheduler for support emails
|
||||||
if cint(self.doc.sync_support_mails):
|
if cint(self.doc.sync_support_mails):
|
||||||
|
if not (self.doc.support_host and self.doc.support_username and self.doc.support_password):
|
||||||
|
webnotes.msgprint("You must give the incoming POP3 settings for support emails to activiate mailbox integration", raise_exception=1)
|
||||||
|
|
||||||
from webnotes.utils.scheduler import set_event
|
from webnotes.utils.scheduler import set_event
|
||||||
set_event('support.doctype.support_ticket.get_support_mails', 60*5, 1)
|
set_event('support.doctype.support_ticket.get_support_mails', 60*5, 1)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -5,14 +5,14 @@
|
|||||||
{
|
{
|
||||||
'creation': '2010-08-08 17:08:59',
|
'creation': '2010-08-08 17:08:59',
|
||||||
'docstatus': 0,
|
'docstatus': 0,
|
||||||
'modified': '2011-07-25 11:07:14',
|
'modified': '2011-07-25 15:03:51',
|
||||||
'modified_by': 'Administrator',
|
'modified_by': 'Administrator',
|
||||||
'owner': 'harshada@webnotestech.com'
|
'owner': 'harshada@webnotestech.com'
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocType
|
# These values are common for all DocType
|
||||||
{
|
{
|
||||||
'_last_update': '1300962303',
|
'_last_update': '1311586371',
|
||||||
'allow_copy': 1,
|
'allow_copy': 1,
|
||||||
'allow_email': 1,
|
'allow_email': 1,
|
||||||
'allow_print': 1,
|
'allow_print': 1,
|
||||||
@ -24,7 +24,7 @@
|
|||||||
'name': '__common__',
|
'name': '__common__',
|
||||||
'section_style': 'Simple',
|
'section_style': 'Simple',
|
||||||
'server_code_error': ' ',
|
'server_code_error': ' ',
|
||||||
'version': 30
|
'version': 34
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocField
|
# These values are common for all DocField
|
||||||
@ -77,12 +77,21 @@
|
|||||||
'label': 'Outgoing Mails'
|
'label': 'Outgoing Mails'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
# DocField
|
||||||
|
{
|
||||||
|
'doctype': 'DocField',
|
||||||
|
'fieldtype': 'HTML',
|
||||||
|
'idx': 2,
|
||||||
|
'label': '1',
|
||||||
|
'options': '<div class="help_box">Set your outgoing mail settings here. All system generated notifications, emails will go from this mail server</div>'
|
||||||
|
},
|
||||||
|
|
||||||
# DocField
|
# DocField
|
||||||
{
|
{
|
||||||
'doctype': 'DocField',
|
'doctype': 'DocField',
|
||||||
'fieldname': 'outgoing_mail_server',
|
'fieldname': 'outgoing_mail_server',
|
||||||
'fieldtype': 'Data',
|
'fieldtype': 'Data',
|
||||||
'idx': 2,
|
'idx': 3,
|
||||||
'label': 'Outgoing Mail Server'
|
'label': 'Outgoing Mail Server'
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -91,7 +100,7 @@
|
|||||||
'doctype': 'DocField',
|
'doctype': 'DocField',
|
||||||
'fieldname': 'mail_port',
|
'fieldname': 'mail_port',
|
||||||
'fieldtype': 'Data',
|
'fieldtype': 'Data',
|
||||||
'idx': 3,
|
'idx': 4,
|
||||||
'label': 'Mail Port'
|
'label': 'Mail Port'
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -100,7 +109,7 @@
|
|||||||
'doctype': 'DocField',
|
'doctype': 'DocField',
|
||||||
'fieldname': 'use_ssl',
|
'fieldname': 'use_ssl',
|
||||||
'fieldtype': 'Check',
|
'fieldtype': 'Check',
|
||||||
'idx': 4,
|
'idx': 5,
|
||||||
'label': 'Use SSL'
|
'label': 'Use SSL'
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -109,7 +118,7 @@
|
|||||||
'doctype': 'DocField',
|
'doctype': 'DocField',
|
||||||
'fieldname': 'mail_login',
|
'fieldname': 'mail_login',
|
||||||
'fieldtype': 'Data',
|
'fieldtype': 'Data',
|
||||||
'idx': 5,
|
'idx': 6,
|
||||||
'label': 'Login Id'
|
'label': 'Login Id'
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -118,7 +127,7 @@
|
|||||||
'doctype': 'DocField',
|
'doctype': 'DocField',
|
||||||
'fieldname': 'mail_password',
|
'fieldname': 'mail_password',
|
||||||
'fieldtype': 'Password',
|
'fieldtype': 'Password',
|
||||||
'idx': 6,
|
'idx': 7,
|
||||||
'label': 'Mail Password'
|
'label': 'Mail Password'
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -127,43 +136,67 @@
|
|||||||
'doctype': 'DocField',
|
'doctype': 'DocField',
|
||||||
'fieldname': 'auto_email_id',
|
'fieldname': 'auto_email_id',
|
||||||
'fieldtype': 'Data',
|
'fieldtype': 'Data',
|
||||||
'idx': 7,
|
'idx': 8,
|
||||||
'label': 'Auto Email Id'
|
'label': 'Auto Email Id'
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
# DocField
|
||||||
{
|
{
|
||||||
|
'description': 'Set the POP3 email settings to pull emails directly from a mailbox and create Support Tickets',
|
||||||
'doctype': 'DocField',
|
'doctype': 'DocField',
|
||||||
'fieldtype': 'Section Break',
|
'fieldtype': 'Section Break',
|
||||||
'idx': 8,
|
'idx': 9,
|
||||||
'label': 'Support Ticket Mail Settings'
|
'label': 'Support Ticket Mail Settings'
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
# DocField
|
||||||
{
|
{
|
||||||
|
'doctype': 'DocField',
|
||||||
|
'fieldtype': 'HTML',
|
||||||
|
'idx': 10,
|
||||||
|
'label': '2',
|
||||||
|
'options': '<div class="help_box">To automatically create Support Tickets from your incoming mail, set your pop3 settings here.</div>'
|
||||||
|
},
|
||||||
|
|
||||||
|
# DocField
|
||||||
|
{
|
||||||
|
'doctype': 'DocField',
|
||||||
|
'fieldtype': 'Section Break',
|
||||||
|
'idx': 11,
|
||||||
|
'options': 'Simple'
|
||||||
|
},
|
||||||
|
|
||||||
|
# DocField
|
||||||
|
{
|
||||||
|
'colour': 'White:FFF',
|
||||||
|
'description': 'Check this to pull emails from your mailbox',
|
||||||
'doctype': 'DocField',
|
'doctype': 'DocField',
|
||||||
'fieldname': 'sync_support_mails',
|
'fieldname': 'sync_support_mails',
|
||||||
'fieldtype': 'Check',
|
'fieldtype': 'Check',
|
||||||
'idx': 9,
|
'idx': 12,
|
||||||
'label': 'Sync Support Mails'
|
'label': 'Sync Support Mails'
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
# DocField
|
||||||
{
|
{
|
||||||
|
'colour': 'White:FFF',
|
||||||
|
'description': 'Your support email id - must be a valid email - this is where your emails will come!',
|
||||||
'doctype': 'DocField',
|
'doctype': 'DocField',
|
||||||
'fieldname': 'support_email',
|
'fieldname': 'support_email',
|
||||||
'fieldtype': 'Data',
|
'fieldtype': 'Data',
|
||||||
'idx': 10,
|
'idx': 13,
|
||||||
'label': 'Support Email'
|
'label': 'Support Email'
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
# DocField
|
||||||
{
|
{
|
||||||
|
'colour': 'White:FFF',
|
||||||
|
'description': 'POP3 mail server (e.g. pop.gmail.com)',
|
||||||
'doctype': 'DocField',
|
'doctype': 'DocField',
|
||||||
'fieldname': 'support_host',
|
'fieldname': 'support_host',
|
||||||
'fieldtype': 'Data',
|
'fieldtype': 'Data',
|
||||||
'idx': 11,
|
'idx': 14,
|
||||||
'label': 'Mail Server'
|
'label': 'POP3 Mail Server'
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
# DocField
|
||||||
@ -171,7 +204,7 @@
|
|||||||
'doctype': 'DocField',
|
'doctype': 'DocField',
|
||||||
'fieldname': 'support_use_ssl',
|
'fieldname': 'support_use_ssl',
|
||||||
'fieldtype': 'Check',
|
'fieldtype': 'Check',
|
||||||
'idx': 12,
|
'idx': 15,
|
||||||
'label': 'Use SSL'
|
'label': 'Use SSL'
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -180,7 +213,7 @@
|
|||||||
'doctype': 'DocField',
|
'doctype': 'DocField',
|
||||||
'fieldname': 'support_username',
|
'fieldname': 'support_username',
|
||||||
'fieldtype': 'Data',
|
'fieldtype': 'Data',
|
||||||
'idx': 13,
|
'idx': 16,
|
||||||
'label': 'User Name'
|
'label': 'User Name'
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -189,7 +222,7 @@
|
|||||||
'doctype': 'DocField',
|
'doctype': 'DocField',
|
||||||
'fieldname': 'support_password',
|
'fieldname': 'support_password',
|
||||||
'fieldtype': 'Password',
|
'fieldtype': 'Password',
|
||||||
'idx': 14,
|
'idx': 17,
|
||||||
'label': 'Support Password'
|
'label': 'Support Password'
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -197,24 +230,28 @@
|
|||||||
{
|
{
|
||||||
'doctype': 'DocField',
|
'doctype': 'DocField',
|
||||||
'fieldtype': 'Column Break',
|
'fieldtype': 'Column Break',
|
||||||
'idx': 15
|
'idx': 18
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
# DocField
|
||||||
{
|
{
|
||||||
|
'colour': 'White:FFF',
|
||||||
|
'description': 'Signature to be appended at the end of every email',
|
||||||
'doctype': 'DocField',
|
'doctype': 'DocField',
|
||||||
'fieldname': 'support_signature',
|
'fieldname': 'support_signature',
|
||||||
'fieldtype': 'Text',
|
'fieldtype': 'Text',
|
||||||
'idx': 16,
|
'idx': 19,
|
||||||
'label': 'Signature'
|
'label': 'Signature'
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
# DocField
|
||||||
{
|
{
|
||||||
|
'colour': 'White:FFF',
|
||||||
|
'description': 'Autoreply when a new mail is received',
|
||||||
'doctype': 'DocField',
|
'doctype': 'DocField',
|
||||||
'fieldname': 'support_autoreply',
|
'fieldname': 'support_autoreply',
|
||||||
'fieldtype': 'Text',
|
'fieldtype': 'Text',
|
||||||
'idx': 17,
|
'idx': 20,
|
||||||
'label': 'Autoreply'
|
'label': 'Autoreply'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
Loading…
x
Reference in New Issue
Block a user