Merge branch 'master' into edge

This commit is contained in:
Rushabh Mehta
2013-04-03 16:39:02 +05:30
73 changed files with 354 additions and 1679 deletions

View File

@@ -1 +0,0 @@
from __future__ import unicode_literals

View File

@@ -1,14 +0,0 @@
<div class="layout-wrapper">
<a class="close" onclick="window.history.back();">&times;</a>
<h1>Modules Setup</h1>
<hr>
<div class="help" style="width: 300px; float: right">
Select checkbox to show / hide module.
</div>
<div id="modules-list">
</div>
<div>
<button class="btn btn-small btn-primary" id="modules-update"
onclick="wn.pages.modules_setup.update()">Update</button>
</div>
</div>

View File

@@ -1,51 +0,0 @@
wn.require('lib/js/lib/jquery/jquery.ui.sortable.js');
$.extend(wn.pages.modules_setup, {
modules: ['Activity', 'Accounts', 'Selling', 'Buying', 'Stock', 'Manufacturing', 'Projects',
'Support', 'HR', 'Website', 'To Do', 'Messages', 'Calendar', 'Knowledge Base'],
onload: function(wrapper) {
wn.pages.modules_setup.refresh_page(JSON.parse(wn.boot.modules_list || "[]"));
},
refresh_page: function(ml) {
$('#modules-list').empty();
// Hide Setup and Dashboard modules
ml.indexOf('Setup')!=-1 && ml.splice(ml.indexOf('Setup'), 1);
// checked modules
for(i in ml) {
$('#modules-list').append(repl('<p style="cursor:move;">\
<input type="checkbox" data-module="%(m)s"> \
%(m)s</p>', {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('<p style="cursor:move;">\
<input type="checkbox" data-module="%(m)s"> \
%(m)s</p>', {m:all[i]}));
}
}
},
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)
});
}
});

View File

@@ -1,9 +0,0 @@
from __future__ import unicode_literals
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()

View File

@@ -1,32 +0,0 @@
[
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2012-06-14 15:07:28",
"modified_by": "Administrator",
"modified": "2012-10-04 16:55:31"
},
{
"name": "__common__",
"title": "Modules Setup",
"module": "Setup",
"doctype": "Page",
"page_name": "modules_setup",
"standard": "Yes"
},
{
"parent": "modules_setup",
"name": "__common__",
"doctype": "Page Role",
"parenttype": "Page",
"role": "System Manager",
"parentfield": "roles"
},
{
"name": "modules_setup",
"doctype": "Page"
},
{
"doctype": "Page Role"
}
]