diff --git a/config.json b/config.json
new file mode 100644
index 0000000000..ffc6d2cc13
--- /dev/null
+++ b/config.json
@@ -0,0 +1,32 @@
+{
+ "modules": {
+ "Activity": {
+ "type": "page",
+ "link": "activity",
+ "color": "#633501",
+ "icon": "icon-play",
+ "label": "Activity"
+ },
+ "To Do": {
+ "type": "page",
+ "link": "todo",
+ "color": "#febf04",
+ "label": "To Do",
+ "icon": "icon-check"
+ },
+ "Calendar": {
+ "type": "view",
+ "link": "Calendar/Event",
+ "color": "#026584",
+ "label": "Calendar",
+ "icon": "icon-calendar"
+ },
+ "Messages": {
+ "type": "page",
+ "link": "messages",
+ "color": "#8d016e",
+ "label": "Messages",
+ "icon": "icon-comments"
+ }
+ }
+}
\ No newline at end of file
diff --git a/core/page/desktop/desktop.js b/core/page/desktop/desktop.js
index 87181d8a98..9b1e9e1610 100644
--- a/core/page/desktop/desktop.js
+++ b/core/page/desktop/desktop.js
@@ -42,7 +42,7 @@ erpnext.desktop.render = function() {
// modules
var modules_list = wn.user.get_desktop_items();
$.each(modules_list, function(i, m) {
- if(!in_list(['Setup', 'Core'], m) && wn.boot.profile.allow_modules.indexOf(m)!=-1)
+ if(m!="Setup")
add_icon(m);
})
diff --git a/core/page/messages/__init__.py b/core/page/messages/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/core/page/messages/messages.css b/core/page/messages/messages.css
new file mode 100644
index 0000000000..88bbde7e86
--- /dev/null
+++ b/core/page/messages/messages.css
@@ -0,0 +1,32 @@
+#message-post-text {
+}
+
+#message-list {
+}
+
+.message {
+ padding: 7px;
+ padding-left: 17px;
+ border-bottom: 1px solid #ccc;
+}
+
+.message-mark {
+ margin-left: -17px;
+ width: 9px;
+ position: absolute;
+ height: 30px;
+}
+
+.message .help {
+ margin-bottom: 0px;
+ padding-bottom: 0px;
+ color: #888;
+ font-size: 11px;
+}
+
+.message-other {
+}
+
+.message-self {
+ background-color: #eee;
+}
\ No newline at end of file
diff --git a/core/page/messages/messages.html b/core/page/messages/messages.html
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/core/page/messages/messages.js b/core/page/messages/messages.js
new file mode 100644
index 0000000000..cf5d790e53
--- /dev/null
+++ b/core/page/messages/messages.js
@@ -0,0 +1,214 @@
+// 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 .
+
+wn.provide('erpnext.messages');
+
+wn.pages.messages.onload = function(wrapper) {
+ wn.ui.make_app_page({
+ parent: wrapper,
+ title: "Messages"
+ });
+
+ $('
', p))
+ .appendTo($body);
+ }
+ }
+ }
+ });
+ }
+});
+
+
diff --git a/core/page/messages/messages.py b/core/page/messages/messages.py
new file mode 100644
index 0000000000..90f5e9152f
--- /dev/null
+++ b/core/page/messages/messages.py
@@ -0,0 +1,117 @@
+# 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
+
+@webnotes.whitelist()
+def get_list(arg=None):
+ """get list of messages"""
+ webnotes.form_dict['limit_start'] = int(webnotes.form_dict['limit_start'])
+ webnotes.form_dict['limit_page_length'] = int(webnotes.form_dict['limit_page_length'])
+ webnotes.form_dict['user'] = webnotes.session['user']
+
+ # set all messages as read
+ webnotes.conn.begin()
+ webnotes.conn.sql("""UPDATE `tabComment`
+ set docstatus = 1 where comment_doctype in ('My Company', 'Message')
+ and comment_docname = %s
+ """, webnotes.user.name)
+ webnotes.conn.commit()
+
+ if webnotes.form_dict['contact'] == webnotes.session['user']:
+ # return messages
+ return webnotes.conn.sql("""select * from `tabComment`
+ where (owner=%(contact)s
+ or comment_docname=%(user)s
+ or (owner=comment_docname and ifnull(parenttype, "")!="Assignment"))
+ and comment_doctype ='Message'
+ order by creation desc
+ limit %(limit_start)s, %(limit_page_length)s""", webnotes.form_dict, as_dict=1)
+ else:
+ return webnotes.conn.sql("""select * from `tabComment`
+ where (owner=%(contact)s and comment_docname=%(user)s)
+ or (owner=%(user)s and comment_docname=%(contact)s)
+ or (owner=%(contact)s and comment_docname=%(contact)s)
+ and comment_doctype ='Message'
+ order by creation desc
+ limit %(limit_start)s, %(limit_page_length)s""", webnotes.form_dict, as_dict=1)
+
+
+@webnotes.whitelist()
+def get_active_users(arg=None):
+ return webnotes.conn.sql("""select name,
+ (select count(*) from tabSessions where user=tabProfile.name
+ and timediff(now(), lastupdate) < time("01:00:00")) as has_session
+ from tabProfile
+ where ifnull(enabled,0)=1 and
+ docstatus < 2 and
+ name not in ('Administrator', 'Guest')
+ order by first_name""", as_dict=1)
+
+@webnotes.whitelist()
+def post(arg=None):
+ import webnotes
+ """post message"""
+ if not arg:
+ arg = {}
+ arg.update(webnotes.form_dict)
+
+ if isinstance(arg, basestring):
+ import json
+ arg = json.loads(arg)
+
+ from webnotes.model.doc import Document
+ d = Document('Comment')
+ d.parenttype = arg.get("parenttype")
+ d.comment = arg['txt']
+ d.comment_docname = arg['contact']
+ d.comment_doctype = 'Message'
+ d.save()
+
+ import webnotes.utils
+ if webnotes.utils.cint(arg.get('notify')):
+ notify(arg)
+
+@webnotes.whitelist()
+def delete(arg=None):
+ webnotes.conn.sql("""delete from `tabComment` where name=%s""",
+ webnotes.form_dict['name']);
+
+def notify(arg=None):
+ from webnotes.utils import cstr, get_fullname
+ from startup import get_url
+
+ fn = get_fullname(webnotes.user.name) or webnotes.user.name
+
+ url = get_url()
+
+ message = '''You have a message from %s:
+
+ %s
+
+ To answer, please login to your erpnext account at \
+ %s
+ ''' % (fn, arg['txt'], url, url)
+
+ sender = webnotes.conn.get_value("Profile", webnotes.user.name, "email") \
+ or webnotes.user.name
+ recipient = [webnotes.conn.get_value("Profile", arg["contact"], "email") \
+ or arg["contact"]]
+
+ from webnotes.utils.email_lib import sendmail
+ sendmail(recipient, sender, message, arg.get("subject") or "You have a message from %s" % (fn,))
+
\ No newline at end of file
diff --git a/core/page/messages/messages.txt b/core/page/messages/messages.txt
new file mode 100644
index 0000000000..0949bd7fbb
--- /dev/null
+++ b/core/page/messages/messages.txt
@@ -0,0 +1,32 @@
+[
+ {
+ "creation": "2012-06-14 18:44:56",
+ "docstatus": 0,
+ "modified": "2013-04-03 14:48:57",
+ "modified_by": "Administrator",
+ "owner": "Administrator"
+ },
+ {
+ "doctype": "Page",
+ "module": "Core",
+ "name": "__common__",
+ "page_name": "messages",
+ "standard": "Yes",
+ "title": "Messages"
+ },
+ {
+ "doctype": "Page Role",
+ "name": "__common__",
+ "parent": "messages",
+ "parentfield": "roles",
+ "parenttype": "Page",
+ "role": "All"
+ },
+ {
+ "doctype": "Page",
+ "name": "messages"
+ },
+ {
+ "doctype": "Page Role"
+ }
+]
\ No newline at end of file
diff --git a/core/page/modules_setup/__init__.py b/core/page/modules_setup/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/core/page/modules_setup/modules_setup.js b/core/page/modules_setup/modules_setup.js
new file mode 100644
index 0000000000..e5de902520
--- /dev/null
+++ b/core/page/modules_setup/modules_setup.js
@@ -0,0 +1,51 @@
+
+wn.pages['modules_setup'].onload = function(wrapper) {
+ wn.ui.make_app_page({
+ parent: wrapper,
+ title: 'Show or Hide Modules',
+ single_column: true
+ });
+
+ wrapper.appframe.add_button("Update", function() {
+ wn.modules_setup.update();
+ })
+
+ $('
\ No newline at end of file
diff --git a/core/page/todo/todo.js b/core/page/todo/todo.js
new file mode 100644
index 0000000000..64ab0a3a29
--- /dev/null
+++ b/core/page/todo/todo.js
@@ -0,0 +1,212 @@
+// 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 .
+
+wn.provide('erpnext.todo');
+
+erpnext.todo.refresh = function() {
+ wn.call({
+ method: 'core.page.todo.todo.get',
+ callback: function(r,rt) {
+ var todo_list = $('#todo-list div.todo-content');
+ var assigned_todo_list = $('#assigned-todo-list div.todo-content');
+ todo_list.empty();
+ assigned_todo_list.empty();
+
+ var nothing_to_do = function() {
+ $('#todo-list div.todo-content')
+ .html('