@@ -70,7 +70,7 @@ def get_bootinfo(): | |||||
def load_conf_settings(bootinfo): | def load_conf_settings(bootinfo): | ||||
from frappe import conf | from frappe import conf | ||||
bootinfo.max_file_size = conf.get('max_file_size') or 10485760 | bootinfo.max_file_size = conf.get('max_file_size') or 10485760 | ||||
for key in ['developer_mode']: | |||||
for key in ('developer_mode', 'socketio_port'): | |||||
if key in conf: bootinfo[key] = conf.get(key) | if key in conf: bootinfo[key] = conf.get(key) | ||||
def load_desktop_icons(bootinfo): | def load_desktop_icons(bootinfo): | ||||
@@ -17,7 +17,7 @@ def get_data(): | |||||
"type": "doctype", | "type": "doctype", | ||||
"name": "Event", | "name": "Event", | ||||
"label": _("Calendar"), | "label": _("Calendar"), | ||||
"view": "Calendar", | |||||
"link": "Calendar/Event", | |||||
"description": _("Event and other calendars."), | "description": _("Event and other calendars."), | ||||
}, | }, | ||||
{ | { | ||||
@@ -368,15 +368,20 @@ frappe.get_desktop_icons = function(show_hidden) { | |||||
if(m.type==="page") { | if(m.type==="page") { | ||||
out = m.link in frappe.boot.page_info; | out = m.link in frappe.boot.page_info; | ||||
} | } | ||||
if(m._doctype) { | |||||
else if(m._doctype) { | |||||
out = frappe.model.can_read(m._doctype); | out = frappe.model.can_read(m._doctype); | ||||
} else { | } else { | ||||
out = frappe.boot.user.allow_modules.indexOf(m.module_name) !== -1 | |||||
if(m.module_name==='Learn') { | |||||
// no permissions necessary for learn | |||||
out = true; | |||||
} else { | |||||
out = frappe.boot.user.allow_modules.indexOf(m.module_name) !== -1 | |||||
} | |||||
} | } | ||||
if(out && !show_hidden) { | if(out && !show_hidden) { | ||||
if(m.hidden) out = false; | if(m.hidden) out = false; | ||||
} | } | ||||
return out; | return out; | ||||
} | } | ||||
@@ -77,11 +77,12 @@ frappe.socket = { | |||||
get_host: function() { | get_host: function() { | ||||
var host = window.location.origin; | var host = window.location.origin; | ||||
if(window.dev_server) { | if(window.dev_server) { | ||||
parts = host.split(":"); | |||||
var parts = host.split(":"); | |||||
var port = frappe.boot.socketio_port || '3000'; | |||||
if(parts.length > 2) { | if(parts.length > 2) { | ||||
host = parts[0] + ":" + parts[1]; | host = parts[0] + ":" + parts[1]; | ||||
} | } | ||||
host = host + ":3000"; | |||||
host = host + ":" + port; | |||||
} | } | ||||
return host; | return host; | ||||
}, | }, | ||||
@@ -271,7 +271,7 @@ function get_conf() { | |||||
var read_config = function(path) { | var read_config = function(path) { | ||||
if(fs.existsSync(path)){ | if(fs.existsSync(path)){ | ||||
var bench_config = JSON.parse(fs.readFileSync(path)); | var bench_config = JSON.parse(fs.readFileSync(path)); | ||||
for (var key in conf) { | |||||
for (var key in bench_config) { | |||||
if (bench_config[key]) { | if (bench_config[key]) { | ||||
conf[key] = bench_config[key]; | conf[key] = bench_config[key]; | ||||
} | } | ||||