diff --git a/erpnext/home/page/desktop/desktop.js b/erpnext/home/page/desktop/desktop.js
index e2a8d5386e..ebd3da1dda 100644
--- a/erpnext/home/page/desktop/desktop.js
+++ b/erpnext/home/page/desktop/desktop.js
@@ -44,35 +44,60 @@ erpnext.desktop.add_classes = function() {
erpnext.desktop.render = function() {
var icons = [
- { gradient: 'brown', sprite: 'feed', label: 'Activity', link: '#!Event Updates' },
- { gradient: 'blue', sprite: 'account', label: 'Accounts', link: '#!accounts-home' },
- { gradient: 'green', sprite: 'selling', label: 'Selling', link: '#!selling-home' },
- { gradient: 'yellow', sprite: 'stock', label: 'Stock', link: '#!stock-home' },
- { gradient: 'red', sprite: 'buying', label: 'Buying', link: '#!buying-home' },
- { gradient: 'purple', sprite: 'support', label: 'Support', link: '#!support-home' },
- { gradient: 'ocean', sprite: 'hr', label: 'Human
Resources', link: '#!hr-home' },
- { gradient: 'violet', sprite: 'project', label: 'Projects', link: '#!projects-home' },
- { gradient: 'dark-red', sprite: 'production', label: 'Production', link: '#!production-home' },
- { gradient: 'leaf-green', sprite: 'website', label: 'Website', link: '#!website-home' },
- { gradient: 'grey', sprite: 'setting', label: 'Settings', link: '#!Setup' },
- { gradient: 'bright-green', sprite: 'dashboard', label: 'Dashboard', link: '#!dashboard' },
- //{ gradient: 'dark-blue', sprite: 'report', label: 'Report' },
- { gradient: 'pink', sprite: 'messages', label: 'Messages', link: '#!messages' },
- { gradient: 'bright-yellow', sprite: 'todo', label: 'To Do', link: '#!todo' },
- { gradient: 'peacock', sprite: 'calendar', label: 'Calendar', link: '#!calendar' },
- { gradient: 'ultra-dark-green', sprite: 'kb', label: 'Knowledge
Base', link: '#!questions' },
+ { gradient: 'blue', sprite: 'account', label: 'Accounts', link: '#!accounts-home',
+ is_module: 'Accounts'},
+ { gradient: 'green', sprite: 'selling', label: 'Selling', link: '#!selling-home',
+ is_module: 'Selling'},
+ { gradient: 'yellow', sprite: 'stock', label: 'Stock', link: '#!stock-home',
+ is_module: 'Stock'},
+ { gradient: 'red', sprite: 'buying', label: 'Buying', link: '#!buying-home',
+ is_module: 'Buying'},
+ { gradient: 'purple', sprite: 'support', label: 'Support', link: '#!support-home',
+ is_module: 'Support'},
+ { gradient: 'ocean', sprite: 'hr', label: 'Human
Resources', link: '#!hr-home',
+ is_module: 'HR'},
+ { gradient: 'violet', sprite: 'project', label: 'Projects', link: '#!projects-home',
+ is_module: 'Projects'},
+ { gradient: 'dark-red', sprite: 'production', label: 'Production', link: '#!production-home',
+ is_module: 'Production'},
+ { gradient: 'leaf-green', sprite: 'website', label: 'Website', link: '#!website-home',
+ is_module: 'Website'},
]
- $.each(icons, function(i, v) {
- var icon_case = $('#icon-grid').append(repl('\
+ var add_icon = function(v) {
+ $('#icon-grid').append(repl('\
\ + \ + %(m)s
', {m:ml[i]})); + } + $('#modules-list [data-module]').attr('checked', true); + + // unchecked modules + var all = wn.pages.modules_setup.modules; + for(i in all) { + if(!$('#modules-list [data-module="'+all[i]+'"]').length) { + $('#modules-list').append(repl('\ + \ + %(m)s
', {m:all[i]})); + } + } + + $('#modules-list').sortable(); + + }, + update: function() { + var ml = []; + $('#modules-list [data-module]').each(function() { + if($(this).attr('checked')) + ml.push($(this).attr('data-module')); + }); + + wn.call({ + method: 'setup.page.modules_setup.modules_setup.update', + args: { + ml: JSON.stringify(ml) + }, + callback: function(r) { + }, + btn: $('#modules-update').get(0) + }); + } +}); \ No newline at end of file diff --git a/erpnext/setup/page/modules_setup/modules_setup.py b/erpnext/setup/page/modules_setup/modules_setup.py new file mode 100644 index 0000000000..ee36dfaeaa --- /dev/null +++ b/erpnext/setup/page/modules_setup/modules_setup.py @@ -0,0 +1,8 @@ +import webnotes + +@webnotes.whitelist() +def update(arg=None): + """update modules""" + webnotes.conn.set_global('modules_list', webnotes.form_dict['ml']) + webnotes.msgprint('Updated') + webnotes.clear_cache() \ No newline at end of file diff --git a/erpnext/setup/page/modules_setup/modules_setup.txt b/erpnext/setup/page/modules_setup/modules_setup.txt new file mode 100644 index 0000000000..70c6a90cc2 --- /dev/null +++ b/erpnext/setup/page/modules_setup/modules_setup.txt @@ -0,0 +1,28 @@ +# Page, modules_setup +[ + + # These values are common in all dictionaries + { + 'creation': '2012-02-28 17:48:39', + 'docstatus': 0, + 'modified': '2012-02-28 17:48:39', + 'modified_by': u'Administrator', + 'owner': u'Administrator' + }, + + # These values are common for all Page + { + 'doctype': 'Page', + 'module': u'Setup', + 'name': '__common__', + 'page_name': u'modules_setup', + 'standard': u'Yes', + 'title': u'Modules Setup' + }, + + # Page, modules_setup + { + 'doctype': 'Page', + 'name': u'modules_setup' + } +] \ No newline at end of file diff --git a/erpnext/setup/page/setup/setup.html b/erpnext/setup/page/setup/setup.html index 7963cb9d9a..50ef112bbb 100644 --- a/erpnext/setup/page/setup/setup.html +++ b/erpnext/setup/page/setup/setup.html @@ -20,7 +20,7 @@
- Users
+ Users
Add/remove users, set roles, passwords etc
@@ -31,6 +31,10 @@
Amount based Authorization Rules
Restrict submission rights based on amount
+ Modules Setup
+ Show, hide modules
+