[rename] Support Ticket -> Issue

This commit is contained in:
Rushabh Mehta
2014-11-28 11:45:02 +05:30
parent 1caa1a3708
commit bd9b62ff28
24 changed files with 35 additions and 117 deletions

View File

@@ -10,7 +10,7 @@ no_cache = 1
no_sitemap = 1
def get_context(context):
doc = frappe.get_doc("Support Ticket", frappe.form_dict.name)
doc = frappe.get_doc("Issue", frappe.form_dict.name)
if doc.raised_by == frappe.session.user:
ticket_context = {
"title": doc.name,
@@ -26,7 +26,7 @@ def add_reply(ticket, message):
if not message:
raise frappe.throw(_("Please write something"))
doc = frappe.get_doc("Support Ticket", ticket)
doc = frappe.get_doc("Issue", ticket)
if doc.raised_by != frappe.session.user:
raise frappe.throw(_("You are not allowed to reply to this ticket."), frappe.PermissionError)

View File

@@ -20,7 +20,7 @@ def get_context(context):
@frappe.whitelist()
def get_tickets(start=0):
tickets = frappe.db.sql("""select name, subject, status, creation
from `tabSupport Ticket` where raised_by=%s
from `tabIssue` where raised_by=%s
order by modified desc
limit %s, 20""", (frappe.session.user, cint(start)), as_dict=True)
for t in tickets:
@@ -34,7 +34,7 @@ def make_new_ticket(subject, message):
raise frappe.throw(_("Please write something in subject and message!"))
ticket = frappe.get_doc({
"doctype":"Support Ticket",
"doctype":"Issue",
"subject": subject,
"raised_by": frappe.session.user,
})
@@ -46,7 +46,7 @@ def make_new_ticket(subject, message):
"content": message,
"sender": frappe.session.user,
"sent_or_received": "Received",
"reference_doctype": "Support Ticket",
"reference_doctype": "Issue",
"reference_name": ticket.name
})
comm.insert(ignore_permissions=True)