2012-07-19 08:10:31 +00:00
|
|
|
from __future__ import unicode_literals
|
2012-03-21 06:59:56 +00:00
|
|
|
install_docs = [
|
2012-04-17 06:15:35 +00:00
|
|
|
{"doctype":"Role", "role_name":"Blogger", "name":"Blogger"},
|
|
|
|
{"doctype":"Role", "role_name":"Website Manager", "name":"Website Manager"},
|
|
|
|
]
|
2012-04-27 13:09:14 +00:00
|
|
|
|
|
|
|
import webnotes
|
|
|
|
|
|
|
|
@webnotes.whitelist(allow_guest=True)
|
|
|
|
def send_message():
|
|
|
|
from webnotes.model.doc import Document
|
|
|
|
args = webnotes.form_dict
|
|
|
|
|
|
|
|
d = Document('Support Ticket')
|
|
|
|
d.subject = webnotes.form_dict.get('subject', 'Website Query')
|
|
|
|
d.description = webnotes.form_dict.get('message')
|
|
|
|
d.raised_by = webnotes.form_dict.get('sender')
|
|
|
|
|
|
|
|
if not d.description:
|
|
|
|
webnotes.msgprint('Please write something', raise_exception=True)
|
|
|
|
|
|
|
|
if not d.raised_by:
|
|
|
|
webnotes.msgprint('Please give us your email id so that we can write back to you', raise_exception=True)
|
|
|
|
|
2012-12-10 05:45:59 +00:00
|
|
|
# make lead or contact
|
|
|
|
|
2012-04-27 13:09:14 +00:00
|
|
|
d.save()
|
2012-10-16 05:17:18 +00:00
|
|
|
webnotes.msgprint('Thank you!')
|
|
|
|
|
|
|
|
def get_site_address():
|
|
|
|
from webnotes.utils import get_request_site_address
|
|
|
|
url = get_request_site_address()
|
|
|
|
|
|
|
|
if not url or url=='http://localhost':
|
|
|
|
new_url = webnotes.conn.get_value('Website Settings', 'Website Settings',
|
|
|
|
'subdomain')
|
|
|
|
if new_url:
|
|
|
|
url = "http://" + new_url
|
|
|
|
|
|
|
|
return url
|