Merge branch 'navupdate' of github.com:webnotes/erpnext into navupdate

This commit is contained in:
Nabin Hait 2012-03-01 13:05:23 +05:30
commit 2b9a13d81f
15 changed files with 77 additions and 29 deletions

View File

@ -1043,7 +1043,7 @@ div.dialog_head {
}
div.dialog_body {
padding: 8px 4px 16px 4px;
padding: 8px 8px 16px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;

View File

@ -362,7 +362,7 @@ div.dialog_head {
}
div.dialog_body {
padding: 8px 4px 16px 4px;
padding: 8px 8px 16px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;

View File

@ -14,12 +14,15 @@ erpnext.ActivityFeed = Class.extend({
init: function(row, data) {
this.scrub_data(data);
this.add_date_separator(row, data);
$(row).append(sprintf('<span %(onclick)s\
class="label %(add_class)s">%(feed_type)s</span>\
%(link)s %(subject)s <span class="user-info">%(by)s</span>', data));
$(row).append(sprintf('<div style="margin: 0px">\
<img src="%(imgsrc)s" style= "height: 24px; margin-bottom: -7px; \
max-width: 24px; margin-right: 5px"> \
<span %(onclick)s class="label %(add_class)s">%(feed_type)s</span>\
%(link)s %(subject)s <span class="user-info">%(by)s</span></div>', data));
},
scrub_data: function(data) {
data.by = wn.user_info(data.owner).fullname;
data.imgsrc = wn.user_info(data.owner).image;
// feedtype
if(!data.feed_type) {

View File

@ -41,10 +41,15 @@
.case-border {
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
width: 56px;
height: 56px;
border: 4px solid white;
box-shadow: 0 0 10px 1px black;
-moz-box-shadow: 0 0 10px 1px black;
-webkit-box-shadow: 0 0 10px 1px black;
-o-box-shadow: 0 0 10px 1px black;
margin: auto;
}
@ -66,6 +71,9 @@
/* Hover and click effects */
.case-border:hover, .circle:hover {
box-shadow: 0 0 2px 0px black, 0 0 10px 1px white;
-moz-box-shadow: 0 0 2px 0px black, 0 0 10px 1px white;
-webkit-box-shadow: 0 0 2px 0px black, 0 0 10px 1px white;
-o-box-shadow: 0 0 2px 0px black, 0 0 10px 1px white;
}
.case-border:active, .case-border:focus, .circle:active, .circle:focus {
@ -78,6 +86,8 @@
.circle {
border-radius: 100%;
-moz-border-radius: 100%;
-webkit-border-radius: 100%;
height: 15px;
min-width: 15px;
background: #B00D07;
@ -88,6 +98,9 @@
margin-right: 10px;
border: 2px solid white;
box-shadow: 0 0 10px 1px black;
-moz-box-shadow: 0 0 10px 1px black;
-webkit-box-shadow: 0 0 10px 1px black;
-o-box-shadow: 0 0 10px 1px black;
}
.circle-text {

View File

@ -3,12 +3,12 @@ wn.provide('erpnext.desktop');
erpnext.desktop.gradient = "<style>\
.case-%(name)s {\
background: %(start)s; /* Old browsers */\
background: -moz-radial-gradient(center, ellipse cover, %(start)s 0%%, %(middle)s 44%%, %(end)s 100%%); /* FF3.6+ */\
background: -webkit-gradient(radial, center center, 0px, center center, 100%%, color-stop(0%%,%(start)s), color-stop(44%%,%(middle)s), color-stop(100%%,%(end)s)); /* Chrome,Safari4+ */\
background: -webkit-radial-gradient(center, ellipse cover, %(start)s 0%%,%(middle)s 44%%,%(end)s 100%%); /* Chrome10+,Safari5.1+ */\
background: -o-radial-gradient(center, ellipse cover, %(start)s 0%%,%(middle)s 44%%,%(end)s 100%%); /* Opera 12+ */\
background: -ms-radial-gradient(center, ellipse cover, %(start)s 0%%,%(middle)s 44%%,%(end)s 100%%); /* IE10+ */\
background: radial-gradient(center, ellipse cover, %(start)s 0%%,%(middle)s 44%%,%(end)s 100%%); /* W3C */\
background: -moz-radial-gradient(center, ellipse cover, %(start)s 0%, %(middle)s 44%, %(end)s 100%); /* FF3.6+ */\
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,%(start)s), color-stop(44%,%(middle)s), color-stop(100%,%(end)s)); /* Chrome,Safari4+ */\
background: -webkit-radial-gradient(center, ellipse cover, %(start)s 0%,%(middle)s 44%,%(end)s 100%); /* Chrome10+,Safari5.1+ */\
background: -o-radial-gradient(center, ellipse cover, %(start)s 0%,%(middle)s 44%,%(end)s 100%); /* Opera 12+ */\
background: -ms-radial-gradient(center, ellipse cover, %(start)s 0%,%(middle)s 44%,%(end)s 100%); /* IE10+ */\
background: radial-gradient(center, ellipse cover, %(start)s 0%,%(middle)s 44%,%(end)s 100%); /* W3C */\
}\
</style>"
@ -79,10 +79,13 @@ erpnext.desktop.render = function() {
for(var i in wn.boot.modules_list) {
var m = wn.boot.modules_list[i];
if(m!='Setup')
if(m!='Setup' && wn.boot.profile.allow_modules.indexOf(m)!=-1)
add_icon(m);
}
if(user_roles.indexOf('Accounts Manager')!=-1)
add_icon('Dashboard')
if(user_roles.indexOf('System Manager')!=-1)
add_icon('Setup')

View File

@ -37,6 +37,12 @@ def execute():
reload_doc('home', 'page', 'activity')
reload_doc('core', 'doctype', 'profile')
# update user_image in profile
for p in webnotes.conn.sql("""select name, file_list from tabProfile
where ifnull(file_list,'')!=''"""):
fid = p[1].split('\n')[0].split(',')[1]
webnotes.conn.set_value('Profile', p[0], 'user_image', fid)
webnotes.conn.set_value('Control Panel', 'Control Panel', 'home_page',
'desktop')

View File

@ -69,7 +69,7 @@ class DocType:
import webnotes, json
args = json.loads(args)
curr_fiscal_year, fy_start_date = self.get_fy_details(args.get('fy_start'))
curr_fiscal_year, fy_start_date, fy_abbr = self.get_fy_details(args.get('fy_start'))
args['name'] = webnotes.session.get('user')
@ -82,7 +82,12 @@ class DocType:
# Fiscal Year
master_dict = {'Fiscal Year':{'year':curr_fiscal_year, 'year_start_date':fy_start_date}}
master_dict = {'Fiscal Year':{
'year': curr_fiscal_year,
'year_start_date': fy_start_date,
'abbreviation': fy_abbr,
'company': args.get('company_name'),
'is_fiscal_year_closed': 'No'}}
self.create_records(master_dict)
# Company
@ -163,9 +168,11 @@ class DocType:
#eddt = sql("select DATE_FORMAT(DATE_SUB(DATE_ADD('%s', INTERVAL 1 YEAR), INTERVAL 1 DAY),'%%d-%%m-%%Y')" % (stdt.split('-')[2]+ '-' + stdt.split('-')[1] + '-' + stdt.split('-')[0]))
if(fy_start == '1st Jan'):
fy = cstr(getdate(nowdate()).year)
abbr = cstr(fy)[-2:]
else:
fy = cstr(curr_year) + '-' + cstr(curr_year+1)
return fy,stdt
abbr = cstr(curr_year)[-2:] + '-' + cstr(curr_year+1)[-2:]
return fy, stdt, abbr
# Create Company and Fiscal Year

View File

@ -87,7 +87,7 @@ erpnext.toolbar.add_modules = function() {
for(var i in wn.boot.modules_list) {
var m = wn.boot.modules_list[i]
if(m!='Setup') {
if(m!='Setup' && wn.boot.profile.allow_modules.indexOf(m)!=-1) {
args = {
module: m,
module_page: erpnext.modules[m],
@ -98,6 +98,12 @@ erpnext.toolbar.add_modules = function() {
data-module="%(module)s">%(module_label)s</a></li>', args));
}
}
// dasboard for accounts system manager
if(user_roles.indexOf("Accounts Manager")!=-1) {
$('.navbar .modules').append('<li><a href="#!dashboard" \
data-module="Dashboard">Dashboard</a></li>');
}
// setup for system manager
if(user_roles.indexOf("System Manager")!=-1) {

View File

@ -34,7 +34,8 @@ erpnext.modules = {
'To Do': 'todo',
'Calendar': 'calendar',
'Messages': 'messages',
'Knowledge Base': 'questions'
'Knowledge Base': 'questions',
'Dashboard': 'dashboard'
}
erpnext.startup.set_globals = function() {
@ -59,6 +60,10 @@ erpnext.startup.start = function() {
wn.title_prefix = wn.boot.website_settings.title_prefix;
}
} else {
// always allow apps
wn.boot.profile.allow_modules = wn.boot.profile.allow_modules.concat(
['To Do', 'Knowledge Base', 'Calendar', 'Activity'])
// setup toolbar
erpnext.toolbar.setup();

View File

@ -178,7 +178,8 @@ EmailMessage = function(parent, args, list, idx) {
// email text
this.message = $a(w, 'div', '',
// style
{lineHeight:'1.7em', display:'none', padding: '7px'},
{lineHeight:'1.7em', display:'none', padding: '7px', width: '575px',
wordWrap: 'break-word', textWrap: 'normal', overflowX: 'auto'},
// newlines for text email
(this.content_type=='text/plain' ? this.mail

View File

@ -151,22 +151,22 @@ $.extend(wn.pages.users, {
this.settings_dialog.fields_dict.update.input.onclick = function() {
var btn = this;
this.set_working();
var args = me.settings_dialog.get_values();
args.user = me.uid;
if (args.new_password) {
me.get_password(btn, args);
} else {
btn.set_working();
me.update_security(args);
me.update_security(btn, args);
}
};
},
update_security: function(args) {
update_security: function(btn, args) {
var me = wn.pages.users;
$(btn).set_working();
$c_page('utilities', 'users', 'update_security', JSON.stringify(args), function(r,rt) {
$(btn).done_working();
if(r.exc) {
msgprint(r.exc);
return;

View File

@ -1,7 +1,7 @@
<div class="layout-wrapper layout-wrapper-background">
<div class="layout-main-section">
<a class="close" onclick="window.history.back();">&times;</a>
<h1>Support</h1>
<h1>Website</h1>
<hr>
<div style="width: 48%; float: left;">
<h4><a href="#!List/Web Page">Web Page</a></h4>

View File

@ -2229,12 +2229,13 @@ wn.modules_path='erpnext';wn.settings.no_history=true;$(document).bind('ready',f
/*
* erpnext/startup/startup.js
*/
var current_module;var is_system_manager=0;wn.provide('erpnext.startup');erpnext.modules={'Selling':'selling-home','Accounts':'accounts-home','Stock':'stock-home','Buying':'buying-home','Support':'support-home','Projects':'projects-home','Production':'production-home','Website':'website-home','HR':'hr-home','Setup':'Setup','Activity':'activity','To Do':'todo','Calendar':'calendar','Messages':'messages','Knowledge Base':'questions'}
var current_module;var is_system_manager=0;wn.provide('erpnext.startup');erpnext.modules={'Selling':'selling-home','Accounts':'accounts-home','Stock':'stock-home','Buying':'buying-home','Support':'support-home','Projects':'projects-home','Production':'production-home','Website':'website-home','HR':'hr-home','Setup':'Setup','Activity':'activity','To Do':'todo','Calendar':'calendar','Messages':'messages','Knowledge Base':'questions','Dashboard':'dashboard'}
erpnext.startup.set_globals=function(){pscript.is_erpnext_saas=cint(wn.control_panel.sync_with_gateway)
if(inList(user_roles,'System Manager'))is_system_manager=1;}
erpnext.startup.start=function(){$('#startup_div').html('Starting up...').toggle(true);erpnext.startup.set_globals();if(wn.boot.custom_css){set_style(wn.boot.custom_css);}
if(wn.boot.user_background){erpnext.set_user_background(wn.boot.user_background);}
if(user=='Guest'){if(wn.boot.website_settings.title_prefix){wn.title_prefix=wn.boot.website_settings.title_prefix;}}else{erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();$('footer').html('<div class="web-footer erpnext-footer">\
if(user=='Guest'){if(wn.boot.website_settings.title_prefix){wn.title_prefix=wn.boot.website_settings.title_prefix;}}else{wn.boot.profile.allow_modules=wn.boot.profile.allow_modules.concat(['To Do','Knowledge Base','Calendar','Activity'])
erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();$('footer').html('<div class="web-footer erpnext-footer">\
Powered by <a href="https://erpnext.com">ERPNext</a></div>');if(in_list(user_roles,'System Manager')&&(wn.boot.setup_complete=='No')){wn.require("erpnext/startup/js/complete_setup.js");erpnext.complete_setup();}}
$('#startup_div').toggle(false);}
show_chart_browser=function(nm,chart_type){var call_back=function(){if(nm=='Sales Browser'){var sb_obj=new SalesBrowser();sb_obj.set_val(chart_type);}
@ -2282,9 +2283,11 @@ erpnext.toolbar.add_modules=function(){$('<li class="dropdown">\
</li>').prependTo('.navbar .nav:first');if(wn.boot.modules_list)
wn.boot.modules_list=JSON.parse(wn.boot.modules_list);else
wn.boot.modules_list=keys(erpnext.modules).sort();for(var i in wn.boot.modules_list){var m=wn.boot.modules_list[i]
if(m!='Setup'){args={module:m,module_page:erpnext.modules[m],module_label:m=='HR'?'Human Resources':m}
if(m!='Setup'&&wn.boot.profile.allow_modules.indexOf(m)!=-1){args={module:m,module_page:erpnext.modules[m],module_label:m=='HR'?'Human Resources':m}
$('.navbar .modules').append(repl('<li><a href="#!%(module_page)s" \
data-module="%(module)s">%(module_label)s</a></li>',args));}}
if(user_roles.indexOf("Accounts Manager")!=-1){$('.navbar .modules').append('<li><a href="#!dashboard" \
data-module="Dashboard">Dashboard</a></li>');}
if(user_roles.indexOf("System Manager")!=-1){$('.navbar .modules').append('<li class="divider"></li>\
<li><a href="#!Setup" data-module="Setup">Setup</a></li>');}}
/*

View File

@ -1077,12 +1077,13 @@ wn.modules_path='erpnext';wn.settings.no_history=true;$(document).bind('ready',f
/*
* erpnext/startup/startup.js
*/
var current_module;var is_system_manager=0;wn.provide('erpnext.startup');erpnext.modules={'Selling':'selling-home','Accounts':'accounts-home','Stock':'stock-home','Buying':'buying-home','Support':'support-home','Projects':'projects-home','Production':'production-home','Website':'website-home','HR':'hr-home','Setup':'Setup','Activity':'activity','To Do':'todo','Calendar':'calendar','Messages':'messages','Knowledge Base':'questions'}
var current_module;var is_system_manager=0;wn.provide('erpnext.startup');erpnext.modules={'Selling':'selling-home','Accounts':'accounts-home','Stock':'stock-home','Buying':'buying-home','Support':'support-home','Projects':'projects-home','Production':'production-home','Website':'website-home','HR':'hr-home','Setup':'Setup','Activity':'activity','To Do':'todo','Calendar':'calendar','Messages':'messages','Knowledge Base':'questions','Dashboard':'dashboard'}
erpnext.startup.set_globals=function(){pscript.is_erpnext_saas=cint(wn.control_panel.sync_with_gateway)
if(inList(user_roles,'System Manager'))is_system_manager=1;}
erpnext.startup.start=function(){$('#startup_div').html('Starting up...').toggle(true);erpnext.startup.set_globals();if(wn.boot.custom_css){set_style(wn.boot.custom_css);}
if(wn.boot.user_background){erpnext.set_user_background(wn.boot.user_background);}
if(user=='Guest'){if(wn.boot.website_settings.title_prefix){wn.title_prefix=wn.boot.website_settings.title_prefix;}}else{erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();$('footer').html('<div class="web-footer erpnext-footer">\
if(user=='Guest'){if(wn.boot.website_settings.title_prefix){wn.title_prefix=wn.boot.website_settings.title_prefix;}}else{wn.boot.profile.allow_modules=wn.boot.profile.allow_modules.concat(['To Do','Knowledge Base','Calendar','Activity'])
erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();$('footer').html('<div class="web-footer erpnext-footer">\
Powered by <a href="https://erpnext.com">ERPNext</a></div>');if(in_list(user_roles,'System Manager')&&(wn.boot.setup_complete=='No')){wn.require("erpnext/startup/js/complete_setup.js");erpnext.complete_setup();}}
$('#startup_div').toggle(false);}
show_chart_browser=function(nm,chart_type){var call_back=function(){if(nm=='Sales Browser'){var sb_obj=new SalesBrowser();sb_obj.set_val(chart_type);}

View File

@ -1 +1 @@
774
781