diff --git a/public/js/startup.css b/public/js/startup.css
index 1cc808d2e7..a4da59cf63 100644
--- a/public/js/startup.css
+++ b/public/js/startup.css
@@ -19,28 +19,6 @@ span, div, td, input, textarea, button, select {
text-align: center;
}
-.navbar-new-comments {
- margin: -3px 0px;
- padding: 2px;
- min-width: 20px;
- text-align: center;
- display: inline-block;
- border-radius: 2px;
- color: #999999;
- background-color: #333131;
-}
-
-.navbar-new-comments:hover,
-.navbar-new-comments:active,
-.navbar-new-comments:focus {
- color: #fff;
-}
-
-.navbar-new-comments-true {
- color: #fff;
- background-color: #B00D07;
-}
-
/*extra size menus for recent*/
.dropdown-menu#toolbar-recent, .dropdown-menu#toolbar-options, .dropdown-menu#toolbar-help{
min-width: 160px !important;
diff --git a/public/js/startup.js b/public/js/startup.js
index f587fbc0c6..96953ad1d0 100644
--- a/public/js/startup.js
+++ b/public/js/startup.js
@@ -35,9 +35,6 @@ erpnext.startup.start = function() {
// setup toolbar
erpnext.toolbar.setup();
- // set interval for updates
- erpnext.startup.set_periodic_updates();
-
// complete registration
if(in_list(user_roles,'System Manager') && (wn.boot.setup_complete=='No')) {
wn.require("app/js/complete_setup.js");
@@ -67,67 +64,6 @@ erpnext.startup.start = function() {
}
}
-
-// ========== Update Messages ============
-erpnext.update_messages = function(reset) {
- // Updates Team Messages
-
- if(inList(['Guest'], user) || !wn.session_alive) { return; }
-
- if(!reset) {
- var set_messages = function(r) {
- if(!r.exc) {
- // This function is defined in toolbar.js
- erpnext.toolbar.set_new_comments(r.message.unread_messages);
-
- var show_in_circle = function(parent_id, msg) {
- var parent = $('#'+parent_id);
- if(parent) {
- if(msg) {
- parent.find('span:first').text(msg);
- parent.toggle(true);
- } else {
- parent.toggle(false);
- }
- }
- }
-
- show_in_circle('unread_messages', r.message.unread_messages);
- show_in_circle('open_support_tickets', r.message.open_support_tickets);
- show_in_circle('things_todo', r.message.things_todo);
- show_in_circle('todays_events', r.message.todays_events);
- show_in_circle('open_tasks', r.message.open_tasks);
- show_in_circle('unanswered_questions', r.message.unanswered_questions);
- show_in_circle('open_leads', r.message.open_leads);
-
- } else {
- clearInterval(wn.updates.id);
- }
- }
-
- wn.call({
- method: 'startup.startup.get_global_status_messages',
- type:"GET",
- callback: set_messages
- });
-
- } else {
- erpnext.toolbar.set_new_comments(0);
- $('#unread_messages').toggle(false);
- }
-}
-
-erpnext.startup.set_periodic_updates = function() {
- // Set interval for periodic updates of team messages
- wn.updates = {};
-
- if(wn.updates.id) {
- clearInterval(wn.updates.id);
- }
-
- wn.updates.id = setInterval(erpnext.update_messages, 60000);
-}
-
erpnext.hide_naming_series = function() {
if(cur_frm.fields_dict.naming_series) {
cur_frm.toggle_display("naming_series", cur_frm.doc.__islocal?true:false);
diff --git a/public/js/toolbar.js b/public/js/toolbar.js
index 1d3d1e7682..4becb23100 100644
--- a/public/js/toolbar.js
+++ b/public/js/toolbar.js
@@ -30,15 +30,11 @@ erpnext.toolbar.setup = function() {
$user.append('
\
'+wn._('Live Chat')+'')
-
- $('.navbar .pull-right').append('\
- ');
-
erpnext.toolbar.set_new_comments();
}
erpnext.toolbar.set_new_comments = function(new_comments) {
+ return;
var navbar_nc = $('.navbar-new-comments');
if(cint(new_comments)) {
navbar_nc.addClass('navbar-new-comments-true')
diff --git a/startup/open_count.py b/startup/open_count.py
index 916ecbd5e0..7a4866b5aa 100644
--- a/startup/open_count.py
+++ b/startup/open_count.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import webnotes
-queries = {
+for_doctype = {
"Support Ticket": {"status":"Open"},
"Customer Issue": {"status":"Open"},
"Task": {"status":"Open"},
@@ -29,4 +29,39 @@ queries = {
"Timesheet": {"docstatus":0},
"Time Log": {"status":"Draft"},
"Time Log Batch": {"status":"Draft"},
-}
\ No newline at end of file
+}
+
+def get_things_todo():
+ """Returns a count of incomplete todos"""
+ incomplete_todos = webnotes.conn.sql("""\
+ SELECT COUNT(*) FROM `tabToDo`
+ WHERE IFNULL(checked, 0) = 0
+ AND (owner = %s or assigned_by=%s)""", (webnotes.session.user, webnotes.session.user))
+ return incomplete_todos[0][0]
+
+def get_todays_events():
+ """Returns a count of todays events in calendar"""
+ from webnotes.utils import nowdate
+ todays_events = webnotes.conn.sql("""\
+ SELECT COUNT(*) FROM `tabEvent`
+ WHERE owner = %s
+ AND event_type != 'Cancel'
+ AND %s between date(starts_on) and date(ends_on)""", (
+ webnotes.session.user, nowdate()))
+ return todays_events[0][0]
+
+def get_unread_messages():
+ "returns unread (docstatus-0 messages for a user)"
+ return webnotes.conn.sql("""\
+ SELECT count(*)
+ FROM `tabComment`
+ WHERE comment_doctype IN ('My Company', 'Message')
+ AND comment_docname = %s
+ AND ifnull(docstatus,0)=0
+ """, webnotes.user.name)[0][0]
+
+for_module = {
+ "To Do": get_things_todo,
+ "Calendar": get_todays_events,
+ "Messages": get_unread_messages
+}
diff --git a/startup/startup.py b/startup/startup.py
deleted file mode 100644
index 2ca2643cb7..0000000000
--- a/startup/startup.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# ERPNext - web based ERP (http://erpnext.com)
-# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
-from __future__ import unicode_literals
-import webnotes
-
-def get_unread_messages():
- "returns unread (docstatus-0 messages for a user)"
- return webnotes.conn.sql("""\
- SELECT count(*)
- FROM `tabComment`
- WHERE comment_doctype IN ('My Company', 'Message')
- AND comment_docname = %s
- AND ifnull(docstatus,0)=0
- """, webnotes.user.name)[0][0]
-
-def get_open_support_tickets():
- """Returns a count of open support tickets"""
- open_support_tickets = webnotes.conn.sql("""\
- SELECT COUNT(*) FROM `tabSupport Ticket`
- WHERE status = 'Open'""")
- return open_support_tickets[0][0]
-
-def get_open_tasks():
- """Returns a count of open tasks"""
- return webnotes.conn.sql("""\
- SELECT COUNT(*) FROM `tabTask`
- WHERE status = 'Open'""")[0][0]
-
-def get_things_todo():
- """Returns a count of incomplete todos"""
- incomplete_todos = webnotes.conn.sql("""\
- SELECT COUNT(*) FROM `tabToDo`
- WHERE IFNULL(checked, 0) = 0
- AND (owner = %s or assigned_by=%s)""", (webnotes.session.user, webnotes.session.user))
- return incomplete_todos[0][0]
-
-def get_todays_events():
- """Returns a count of todays events in calendar"""
- from webnotes.utils import nowdate
- todays_events = webnotes.conn.sql("""\
- SELECT COUNT(*) FROM `tabEvent`
- WHERE owner = %s
- AND event_type != 'Cancel'
- AND %s between date(starts_on) and date(ends_on)""", (
- webnotes.session.user, nowdate()))
- return todays_events[0][0]
-
-def get_open_leads():
- return webnotes.conn.sql("""select count(*) from tabLead
- where status='Open'""")[0][0]
-
-@webnotes.whitelist()
-def get_global_status_messages(arg=None):
- return {
- 'unread_messages': get_unread_messages(),
- 'open_support_tickets': get_open_support_tickets(),
- 'things_todo': get_things_todo(),
- 'todays_events': get_todays_events(),
- 'open_tasks': get_open_tasks(),
- 'open_leads': get_open_leads()
- }