Merge branch 'latest' of github.com:webnotes/erpnext into latest

This commit is contained in:
Anand Doshi 2012-02-13 19:00:24 +05:30
commit 2c582d5f65
2 changed files with 6 additions and 5 deletions

View File

@ -2,7 +2,7 @@ import webnotes
from webnotes.utils import cint
@webnotes.whitelist()
def get_online_users():
def get_online_users(arg=None):
# get users
return webnotes.conn.sql("""SELECT DISTINCT t1.user, t2.first_name, t2.last_name
from tabSessions t1, tabProfile t2
@ -10,8 +10,7 @@ def get_online_users():
and t1.user not in ('Guest','Administrator')
and TIMESTAMPDIFF(HOUR,t1.lastupdate,NOW()) <= 1""", as_list=1) or []
@webnotes.whitelist()
def get_unread_messages():
def get_unread_messages(arg=None):
"returns unread (docstatus-0 messages for a user)"
return cint(webnotes.conn.sql("""SELECT COUNT(*) FROM `tabComment Widget Record`
WHERE comment_doctype='My Company'
@ -41,8 +40,7 @@ def get_status_details(arg=None):
}
return ret
@webnotes.whitelist()
def get_setup_status():
def get_setup_status(arg=None):
"""
Returns the setup status of the current account
"""

View File

@ -107,6 +107,7 @@ def send_welcome_mail(email, args):
#
# post comment
#
@webnotes.whitelist()
def post_comment(arg):
arg = load_json(arg)
@ -149,6 +150,7 @@ def post_comment(arg):
#
# update read messages
#
@webnotes.whitelist()
def set_read_all_messages(arg=''):
webnotes.conn.sql("""UPDATE `tabComment Widget Record`
SET docstatus = 1
@ -156,6 +158,7 @@ def set_read_all_messages(arg=''):
AND comment_docname = %s
""", webnotes.user.name)
@webnotes.whitelist()
def update_security(args=''):
import json
args = json.loads(args)