浏览代码

[messages] show notifications and fix double listing in dropdown

version-14
Rushabh Mehta 9 年前
父节点
当前提交
751e36a533
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. +1
    -2
      frappe/desk/page/messages/messages.py
  2. +3
    -2
      frappe/public/js/frappe/ui/toolbar/notifications.js

+ 1
- 2
frappe/desk/page/messages/messages.py 查看文件

@@ -31,9 +31,9 @@ def get_list(arg=None):
return frappe.db.sql("""select * from `tabComment` return frappe.db.sql("""select * from `tabComment`
where (owner=%(contact)s where (owner=%(contact)s
or comment_docname=%(user)s or comment_docname=%(user)s
or (owner=comment_docname and ifnull(parenttype, "")!="Assignment")
or owner=comment_docname) or owner=comment_docname)
and comment_doctype ='Message' and comment_doctype ='Message'
and ifnull(parenttype, "")!="Assignment"
order by creation desc order by creation desc
limit %(limit_start)s, %(limit_page_length)s""", frappe.local.form_dict, as_dict=1) limit %(limit_start)s, %(limit_page_length)s""", frappe.local.form_dict, as_dict=1)
else: else:
@@ -42,7 +42,6 @@ def get_list(arg=None):
or (owner=%(user)s and comment_docname=%(contact)s) or (owner=%(user)s and comment_docname=%(contact)s)
or (owner=%(contact)s and comment_docname=%(contact)s)) or (owner=%(contact)s and comment_docname=%(contact)s))
and comment_doctype ='Message' and comment_doctype ='Message'
and ifnull(parenttype, "")!="Assignment"
order by creation desc order by creation desc
limit %(limit_start)s, %(limit_page_length)s""", frappe.local.form_dict, as_dict=1) limit %(limit_start)s, %(limit_page_length)s""", frappe.local.form_dict, as_dict=1)




+ 3
- 2
frappe/public/js/frappe/ui/toolbar/notifications.js 查看文件

@@ -23,8 +23,9 @@ frappe.ui.notifications.update_notifications = function() {


// add to toolbar and sidebar // add to toolbar and sidebar
$.each(doctypes, function(i, doctype) { $.each(doctypes, function(i, doctype) {
if(!in_list(["ToDo", "Comment", "Event"]))
frappe.ui.notifications.add_notification(doctype);
if(!in_list(["ToDo", "Comment", "Event"], doctype)) {
frappe.ui.notifications.add_notification(doctype);
}
}); });


// set click events // set click events


正在加载...
取消
保存