mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-04 14:08:29 +00:00
Merge branch 'master' into edge
This commit is contained in:
@@ -1 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
@@ -1,14 +0,0 @@
|
||||
<div class="layout-wrapper">
|
||||
<a class="close" onclick="window.history.back();">×</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>
|
||||
@@ -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)
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -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()
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user