website: made order and ticket listing

This commit is contained in:
Rushabh Mehta
2013-03-22 12:45:44 +05:30
parent 11394f0986
commit da512ba8c9
11 changed files with 257 additions and 61 deletions

View File

@@ -73,8 +73,25 @@ def set_status(name, status):
@webnotes.whitelist()
def get_tickets():
tickets = webnotes.conn.sql("""select name, subject, status from
`tabSupport Ticket` where raised_by=%s order by modified desc""",
tickets = webnotes.conn.sql("""select
name, subject, status
from `tabSupport Ticket`
where raised_by=%s
order by modified desc
limit 20""",
webnotes.session.user, as_dict=1)
return tickets
def get_website_args():
bean = webnotes.bean("Support Ticket", webnotes.form_dict.name)
if bean.doc.raised_by != webnotes.session.user:
return {
"doc": {"name": "Not Allowed"}
}
else:
return {
"doc": bean.doc,
"doclist": bean.doclist,
"webnotes": webnotes,
"utils": webnotes.utils
}