fixes in select field type
This commit is contained in:
parent
b60807c325
commit
2aa9ba63e3
@ -1260,7 +1260,7 @@ button.btn.small, input[type="submit"].btn.small {
|
||||
}
|
||||
|
||||
.icon-white {
|
||||
background-image: url("./lib/images/icons/glyphicons-halflings-white.png");
|
||||
background-image: url("../lib/images/icons/glyphicons-halflings-white.png");
|
||||
}
|
||||
|
||||
.icon-glass {
|
||||
|
@ -1217,7 +1217,7 @@ button.btn.small, input[type="submit"].btn.small {
|
||||
}
|
||||
|
||||
.icon-white {
|
||||
background-image: url("./lib/images/icons/glyphicons-halflings-white.png");
|
||||
background-image: url("../lib/images/icons/glyphicons-halflings-white.png");
|
||||
}
|
||||
|
||||
.icon-glass {
|
||||
|
@ -19,14 +19,12 @@
|
||||
wn.provide('erpnext.complete_setup');
|
||||
|
||||
$.extend(erpnext.complete_setup, {
|
||||
|
||||
show: function() {
|
||||
d = erpnext.complete_setup.prepare_dialog();
|
||||
d.show();
|
||||
},
|
||||
|
||||
prepare_dialog: function() {
|
||||
|
||||
var d = new wn.widgets.Dialog({
|
||||
title: "Setup",
|
||||
fields: [
|
||||
@ -46,7 +44,7 @@ $.extend(erpnext.complete_setup, {
|
||||
{fieldname:'country', label: 'Country', reqd:1,
|
||||
options: erpnext.complete_setup.country_list.join('\n'), fieldtype: 'Select'},
|
||||
{fieldname:'timezone', label: 'Time Zone', reqd:1,
|
||||
options: "", fieldtype: 'Select'},
|
||||
options: '', fieldtype: 'Select'},
|
||||
{fieldname:'update', label:'Setup',fieldtype:'Button'},
|
||||
],
|
||||
});
|
||||
@ -473,6 +471,6 @@ $.extend(erpnext.complete_setup, {
|
||||
'Vietnam': ['Asia/Saigon'],
|
||||
'Yemen': ['Asia/Aden'],
|
||||
'Zambia': ['Africa/Lusaka'],
|
||||
'Zimbabwe': ['Africa/Harare']
|
||||
'Zimbabwe': ['Africa/Harare'],
|
||||
},
|
||||
});
|
@ -43,25 +43,7 @@ erpnext.toolbar.setup = function() {
|
||||
$('#toolbar-help').append('<li><a href="http://www.providesupport.com?messenger=iwebnotes" target="_blank">\
|
||||
Live Chat (Office Hours)</a></li>')
|
||||
|
||||
$.extend(wn.container.wntoolbar, {
|
||||
set_new_comments: function(new_comments) {
|
||||
var navbar_nc = $('.navbar-new-comments');
|
||||
if(new_comments && new_comments.length>0) {
|
||||
navbar_nc.text(new_comments.length);
|
||||
navbar_nc.addClass('navbar-new-comments-true')
|
||||
$.each(new_comments, function(i, v) {
|
||||
var msg = 'New Message: ' + (v[1].length<=100 ? v[1] : (v[1].substr(0, 100) + "..."));
|
||||
var id = v[0].replace('/', '-');
|
||||
if(!$('#' + id)[0]) { show_alert(msg, id); }
|
||||
})
|
||||
} else {
|
||||
navbar_nc.removeClass('navbar-new-comments-true');
|
||||
navbar_nc.text(0);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
wn.container.wntoolbar.set_new_comments();
|
||||
erpnext.toolbar.set_new_comments();
|
||||
}
|
||||
|
||||
erpnext.toolbar.add_modules = function() {
|
||||
@ -73,8 +55,9 @@ erpnext.toolbar.add_modules = function() {
|
||||
</li>').prependTo('.navbar .nav:first');
|
||||
|
||||
// if no modules list then show all
|
||||
if(wn.boot.modules_list)
|
||||
if(wn.boot.modules_list && typeof(wn.boot.modules_list) == 'string') {
|
||||
wn.boot.modules_list = JSON.parse(wn.boot.modules_list);
|
||||
}
|
||||
else
|
||||
wn.boot.modules_list = keys(erpnext.modules).sort();
|
||||
|
||||
@ -108,3 +91,19 @@ erpnext.toolbar.add_modules = function() {
|
||||
|
||||
}
|
||||
|
||||
erpnext.toolbar.set_new_comments = function(new_comments) {
|
||||
var navbar_nc = $('.navbar-new-comments');
|
||||
if(new_comments && new_comments.length>0) {
|
||||
navbar_nc.text(new_comments.length);
|
||||
navbar_nc.addClass('navbar-new-comments-true')
|
||||
$.each(new_comments, function(i, v) {
|
||||
var msg = 'New Message: ' + (v[1].length<=100 ? v[1] : (v[1].substr(0, 100) + "..."));
|
||||
var id = v[0].replace('/', '-');
|
||||
if(!$('#' + id)[0]) { show_alert(msg, id); }
|
||||
})
|
||||
} else {
|
||||
navbar_nc.removeClass('navbar-new-comments-true');
|
||||
navbar_nc.text(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,6 @@ erpnext.startup.start = function() {
|
||||
wn.require("erpnext/startup/js/complete_setup.js");
|
||||
erpnext.complete_setup.show();
|
||||
}
|
||||
|
||||
if(wn.boot.expires_on && in_list(user_roles, 'System Manager')) {
|
||||
var today = dateutil.str_to_obj(dateutil.get_today());
|
||||
var expires_on = dateutil.str_to_obj(wn.boot.expires_on);
|
||||
@ -111,6 +110,7 @@ erpnext.startup.start = function() {
|
||||
</div>', { expiry_string: expiry_string }));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
erpnext.set_about();
|
||||
@ -144,7 +144,7 @@ var update_messages = function(reset) {
|
||||
var set_messages = function(r) {
|
||||
if(!r.exc) {
|
||||
// This function is defined in toolbar.js
|
||||
wn.container.wntoolbar.set_new_comments(r.message.unread_messages);
|
||||
erpnext.toolbar.set_new_comments(r.message.unread_messages);
|
||||
|
||||
var show_in_circle = function(parent_id, msg) {
|
||||
var parent = $('#'+parent_id);
|
||||
@ -174,7 +174,7 @@ var update_messages = function(reset) {
|
||||
});
|
||||
|
||||
} else {
|
||||
wn.container.wntoolbar.set_new_comments(0);
|
||||
erpnext.toolbar.set_new_comments(0);
|
||||
$('#unread_messages').toggle(false);
|
||||
}
|
||||
}
|
||||
|
@ -914,7 +914,7 @@ if(this.df.options=='attach_files:'){this.file_attach=true;}}
|
||||
this.set_as_single=function(){var i=this.input;i.multiple=false;i.style.height=null;if(i.lab)$dh(i.lab)}
|
||||
this.refresh_options=function(options){if(options)
|
||||
me.df.options=options;if(this.file_attach)
|
||||
this.set_attach_options();me.options_list=me.df.options?me.df.options.split('\n'):[];empty_select(this.input);if(me.in_filter&&me.options_list[0]!=''){me.options_list=add_lists([''],me.options_list);}
|
||||
this.set_attach_options();me.options_list=me.df.options?me.df.options.split('\n'):[''];empty_select(this.input);if(me.in_filter&&me.options_list[0]!=''){me.options_list=add_lists([''],me.options_list);}
|
||||
add_sel_options(this.input,me.options_list);}
|
||||
this.onrefresh=function(){this.refresh_options();if(this.not_in_form){this.input.value='';return;}
|
||||
if(_f.get_value)
|
||||
@ -1383,9 +1383,7 @@ wn.ui.toolbar.RecentDocs=Class.extend({init:function(){$('.navbar .nav:first').a
|
||||
</li>');this.setup();this.bind_events();},bind_events:function(){var me=this;$(document).bind('rename',function(event,dt,old_name,new_name){me.rename_notify(dt,old_name,new_name)});},rename_notify:function(dt,old,name){this.remove(dt,old);this.add(dt,name,1);},add:function(dt,dn,on_top){if(this.istable(dt))return;this.remove(dt,dn);var html=repl('<li data-docref="%(dt)s/%(dn)s">\
|
||||
<a href="#Form/%(dt)s/%(dn)s">\
|
||||
%(dn)s <span style="font-size: 10px">(%(dt)s)</span>\
|
||||
</a></li>',{dt:dt,dn:dn});if(on_top){$('#toolbar-recent').prepend(html);}else{$('#toolbar-recent').append(html);}},istable:function(dt){return locals.DocType[dt]&&locals.DocType[dt].istable||false;},remove:function(dt,dn){$(repl('#toolbar-recent li[data-docref="%(dt)s/%(dn)s"]',{dt:dt,dn:dn})).remove();},setup:function(){try{var rlist=JSON.parse(profile.recent);}
|
||||
catch(e){return;}
|
||||
var m=rlist.length;if(m>15)m=15;for(var i=0;i<m;i++){var rd=rlist[i]
|
||||
</a></li>',{dt:dt,dn:dn});if(on_top){$('#toolbar-recent').prepend(html);}else{$('#toolbar-recent').append(html);}},istable:function(dt){return locals.DocType[dt]&&locals.DocType[dt].istable||false;},remove:function(dt,dn){$(repl('#toolbar-recent li[data-docref="%(dt)s/%(dn)s"]',{dt:dt,dn:dn})).remove();},setup:function(){var rlist=JSON.parse(profile.recent||"[]");var m=rlist.length;if(m>15)m=15;for(var i=0;i<m;i++){var rd=rlist[i]
|
||||
if(rd[1]){var dt=rd[0];var dn=rd[1];this.add(dt,dn,0);}}}});
|
||||
/*
|
||||
* lib/js/wn/ui/toolbar/toolbar.js
|
||||
@ -1599,7 +1597,7 @@ if(this.df.options=='attach_files:'){this.file_attach=true;}}
|
||||
this.set_as_single=function(){var i=this.input;i.multiple=false;i.style.height=null;if(i.lab)$dh(i.lab)}
|
||||
this.refresh_options=function(options){if(options)
|
||||
me.df.options=options;if(this.file_attach)
|
||||
this.set_attach_options();me.options_list=me.df.options?me.df.options.split('\n'):[];empty_select(this.input);if(me.in_filter&&me.options_list[0]!=''){me.options_list=add_lists([''],me.options_list);}
|
||||
this.set_attach_options();me.options_list=me.df.options?me.df.options.split('\n'):[''];empty_select(this.input);if(me.in_filter&&me.options_list[0]!=''){me.options_list=add_lists([''],me.options_list);}
|
||||
add_sel_options(this.input,me.options_list);}
|
||||
this.onrefresh=function(){this.refresh_options();if(this.not_in_form){this.input.value='';return;}
|
||||
if(_f.get_value)
|
||||
@ -2223,7 +2221,7 @@ if(wn.boot.website_settings.title_prefix){wn.title_prefix=wn.boot.website_settin
|
||||
if(wn.boot.startup_code){eval(wn.boot.startup_code);}}else{wn.boot.profile.allow_modules=wn.boot.profile.allow_modules.concat(['To Do','Knowledge Base','Calendar','Activity','Messages'])
|
||||
if(user_roles.indexOf('Accounts Manager')!=-1){wn.boot.profile.allow_modules.push('Dashboard');}
|
||||
erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();if(in_list(user_roles,'System Manager')&&(wn.boot.setup_complete=='No')){wn.require("erpnext/startup/js/complete_setup.js");erpnext.complete_setup.show();}
|
||||
if(wn.boot.expires_on){var today=dateutil.str_to_obj(dateutil.get_today());var expires_on=dateutil.str_to_obj(wn.boot.expires_on);var diff=dateutil.get_diff(expires_on,today);if(0<=diff&&diff<=15){var expiry_string=diff==0?"today":repl("in %(diff)s day(s)",{diff:diff});$('header').append(repl('<div class="expiry-info"> \
|
||||
if(wn.boot.expires_on&&in_list(user_roles,'System Manager')){var today=dateutil.str_to_obj(dateutil.get_today());var expires_on=dateutil.str_to_obj(wn.boot.expires_on);var diff=dateutil.get_diff(expires_on,today);if(0<=diff&&diff<=15){var expiry_string=diff==0?"today":repl("in %(diff)s day(s)",{diff:diff});$('header').append(repl('<div class="expiry-info"> \
|
||||
Ahem! Your ERPNext subscription will <b>expire %(expiry_string)s</b>. \
|
||||
Please renew your subscription to continue using ERPNext \
|
||||
(and remove this annoying banner). \
|
||||
@ -2236,9 +2234,9 @@ else if(nm=='Accounts Browser')
|
||||
pscript.make_chart(chart_type);}
|
||||
loadpage(nm,call_back);}
|
||||
var update_messages=function(reset){if(inList(['Guest'],user)||!wn.session_alive){return;}
|
||||
if(!reset){var set_messages=function(r){if(!r.exc){wn.container.wntoolbar.set_new_comments(r.message.unread_messages);var show_in_circle=function(parent_id,msg){var parent=$('#'+parent_id);if(parent){if(msg){parent.find('span:first').text(msg);parent.toggle(true);}else{parent.toggle(false);}}}
|
||||
if(!reset){var set_messages=function(r){if(!r.exc){erpnext.toolbar.set_new_comments(r.message.unread_messages);var show_in_circle=function(parent_id,msg){var parent=$('#'+parent_id);if(parent){if(msg){parent.find('span:first').text(msg);parent.toggle(true);}else{parent.toggle(false);}}}
|
||||
show_in_circle('unread_messages',r.message.unread_messages.length);show_in_circle('open_support_tickets',r.message.open_support_tickets);show_in_circle('things_todo',r.message.things_todo);show_in_circle('todays_events',r.message.todays_events);}else{clearInterval(wn.updates.id);}}
|
||||
wn.call({method:'startup.startup.get_global_status_messages',callback:set_messages});}else{wn.container.wntoolbar.set_new_comments(0);$('#unread_messages').toggle(false);}}
|
||||
wn.call({method:'startup.startup.get_global_status_messages',callback:set_messages});}else{erpnext.toolbar.set_new_comments(0);$('#unread_messages').toggle(false);}}
|
||||
erpnext.startup.set_periodic_updates=function(){wn.updates={};if(wn.updates.id){clearInterval(wn.updates.id);}
|
||||
wn.updates.id=setInterval(update_messages,60000);}
|
||||
erpnext.set_user_background=function(src){set_style(repl('#body_div { background: url("files/%(src)s") repeat;}',{src:src}))}
|
||||
@ -2268,15 +2266,14 @@ $('#toolbar-help').append('<li><a href="http://groups.google.com/group/erpnext-u
|
||||
Forum</a></li>')
|
||||
$('#toolbar-help').append('<li><a href="http://www.providesupport.com?messenger=iwebnotes" target="_blank">\
|
||||
Live Chat (Office Hours)</a></li>')
|
||||
$.extend(wn.container.wntoolbar,{set_new_comments:function(new_comments){var navbar_nc=$('.navbar-new-comments');if(new_comments&&new_comments.length>0){navbar_nc.text(new_comments.length);navbar_nc.addClass('navbar-new-comments-true')
|
||||
$.each(new_comments,function(i,v){var msg='New Message: '+(v[1].length<=100?v[1]:(v[1].substr(0,100)+"..."));var id=v[0].replace('/','-');if(!$('#'+id)[0]){show_alert(msg,id);}})}else{navbar_nc.removeClass('navbar-new-comments-true');navbar_nc.text(0);}}});wn.container.wntoolbar.set_new_comments();}
|
||||
erpnext.toolbar.set_new_comments();}
|
||||
erpnext.toolbar.add_modules=function(){$('<li class="dropdown">\
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#"\
|
||||
onclick="return false;">Modules<b class="caret"></b></a>\
|
||||
<ul class="dropdown-menu modules">\
|
||||
</ul>\
|
||||
</li>').prependTo('.navbar .nav:first');if(wn.boot.modules_list)
|
||||
wn.boot.modules_list=JSON.parse(wn.boot.modules_list);else
|
||||
</li>').prependTo('.navbar .nav:first');if(wn.boot.modules_list&&typeof(wn.boot.modules_list)=='string'){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'&&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" \
|
||||
@ -2285,6 +2282,8 @@ if(user_roles.indexOf("Accounts Manager")!=-1){$('.navbar .modules').append('<li
|
||||
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>');}}
|
||||
erpnext.toolbar.set_new_comments=function(new_comments){var navbar_nc=$('.navbar-new-comments');if(new_comments&&new_comments.length>0){navbar_nc.text(new_comments.length);navbar_nc.addClass('navbar-new-comments-true')
|
||||
$.each(new_comments,function(i,v){var msg='New Message: '+(v[1].length<=100?v[1]:(v[1].substr(0,100)+"..."));var id=v[0].replace('/','-');if(!$('#'+id)[0]){show_alert(msg,id);}})}else{navbar_nc.removeClass('navbar-new-comments-true');navbar_nc.text(0);}}
|
||||
/*
|
||||
* erpnext/startup/js/feature_setup.js
|
||||
*/
|
||||
|
@ -830,7 +830,7 @@ if(wn.boot.website_settings.title_prefix){wn.title_prefix=wn.boot.website_settin
|
||||
if(wn.boot.startup_code){eval(wn.boot.startup_code);}}else{wn.boot.profile.allow_modules=wn.boot.profile.allow_modules.concat(['To Do','Knowledge Base','Calendar','Activity','Messages'])
|
||||
if(user_roles.indexOf('Accounts Manager')!=-1){wn.boot.profile.allow_modules.push('Dashboard');}
|
||||
erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();if(in_list(user_roles,'System Manager')&&(wn.boot.setup_complete=='No')){wn.require("erpnext/startup/js/complete_setup.js");erpnext.complete_setup.show();}
|
||||
if(wn.boot.expires_on){var today=dateutil.str_to_obj(dateutil.get_today());var expires_on=dateutil.str_to_obj(wn.boot.expires_on);var diff=dateutil.get_diff(expires_on,today);if(0<=diff&&diff<=15){var expiry_string=diff==0?"today":repl("in %(diff)s day(s)",{diff:diff});$('header').append(repl('<div class="expiry-info"> \
|
||||
if(wn.boot.expires_on&&in_list(user_roles,'System Manager')){var today=dateutil.str_to_obj(dateutil.get_today());var expires_on=dateutil.str_to_obj(wn.boot.expires_on);var diff=dateutil.get_diff(expires_on,today);if(0<=diff&&diff<=15){var expiry_string=diff==0?"today":repl("in %(diff)s day(s)",{diff:diff});$('header').append(repl('<div class="expiry-info"> \
|
||||
Ahem! Your ERPNext subscription will <b>expire %(expiry_string)s</b>. \
|
||||
Please renew your subscription to continue using ERPNext \
|
||||
(and remove this annoying banner). \
|
||||
@ -843,9 +843,9 @@ else if(nm=='Accounts Browser')
|
||||
pscript.make_chart(chart_type);}
|
||||
loadpage(nm,call_back);}
|
||||
var update_messages=function(reset){if(inList(['Guest'],user)||!wn.session_alive){return;}
|
||||
if(!reset){var set_messages=function(r){if(!r.exc){wn.container.wntoolbar.set_new_comments(r.message.unread_messages);var show_in_circle=function(parent_id,msg){var parent=$('#'+parent_id);if(parent){if(msg){parent.find('span:first').text(msg);parent.toggle(true);}else{parent.toggle(false);}}}
|
||||
if(!reset){var set_messages=function(r){if(!r.exc){erpnext.toolbar.set_new_comments(r.message.unread_messages);var show_in_circle=function(parent_id,msg){var parent=$('#'+parent_id);if(parent){if(msg){parent.find('span:first').text(msg);parent.toggle(true);}else{parent.toggle(false);}}}
|
||||
show_in_circle('unread_messages',r.message.unread_messages.length);show_in_circle('open_support_tickets',r.message.open_support_tickets);show_in_circle('things_todo',r.message.things_todo);show_in_circle('todays_events',r.message.todays_events);}else{clearInterval(wn.updates.id);}}
|
||||
wn.call({method:'startup.startup.get_global_status_messages',callback:set_messages});}else{wn.container.wntoolbar.set_new_comments(0);$('#unread_messages').toggle(false);}}
|
||||
wn.call({method:'startup.startup.get_global_status_messages',callback:set_messages});}else{erpnext.toolbar.set_new_comments(0);$('#unread_messages').toggle(false);}}
|
||||
erpnext.startup.set_periodic_updates=function(){wn.updates={};if(wn.updates.id){clearInterval(wn.updates.id);}
|
||||
wn.updates.id=setInterval(update_messages,60000);}
|
||||
erpnext.set_user_background=function(src){set_style(repl('#body_div { background: url("files/%(src)s") repeat;}',{src:src}))}
|
||||
|
Loading…
x
Reference in New Issue
Block a user