mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-14 18:51:21 +00:00
added module pages and other css updates
This commit is contained in:
@@ -1077,7 +1077,8 @@ $dh(dialog_message);if(!fcount)return;fcount--;if(!fcount){$dh(dialog_back);froz
|
||||
*/
|
||||
var fcount=0;var frozen=0;var dialog_message;var dialog_back;function freeze(msg,do_freeze){if(!dialog_back){dialog_back=$a($i('body_div'),'div','dialog_back');if(isIE)dialog_back.style['filter']='alpha(opacity=60)';}
|
||||
$ds(dialog_back);fcount++;frozen=1;}
|
||||
function unfreeze(){if(dialog_message)
|
||||
function unfreeze(){if(dialog_message)
|
||||
$dh(dialog_message);if(!fcount)return;fcount--;if(!fcount){$dh(dialog_back);frozen=0;}}
|
||||
/*
|
||||
* lib/js/legacy/webpage/error_console.js
|
||||
*/
|
||||
@@ -1334,7 +1335,7 @@ this.make_options();this.make_tools();this.set_user_name();this.make_logout();$(
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" \
|
||||
onclick="return false;" id="toolbar-user-link"></a>\
|
||||
<ul class="dropdown-menu" id="toolbar-user">\
|
||||
</ul>\
|
||||
</ul>\
|
||||
</li>\
|
||||
</ul>\
|
||||
</div>\
|
||||
@@ -1375,7 +1376,8 @@ this.setup_sidebar_menu=function(){if(this.left_sidebar&&this.cp.show_sidebar_me
|
||||
this.ready=function(){$dh('startup_div');$ds('body_div');}
|
||||
this.setup_page_areas=function(){var n=this.no_of_columns();this.body_table=make_table(this.body,1,n,'100%');$y(this.body_table,{tableLayout:'fixed'});var c=0;this.left_sidebar=$td(this.body_table,0,c);$y(this.left_sidebar,{width:cint(this.cp.left_sidebar_width)+'px'});c++;this.center=$a($td(this.body_table,0,c),'div');c++;if(cint(this.cp.right_sidebar_width)){this.right_sidebar=$td(this.body_table,0,c);$y(this.right_sidebar,{width:cint(this.cp.right_sidebar_width)+'px'})
|
||||
c++;}
|
||||
this.center.header=$a(this.center,'div');this.center.body=$a(this.center,'div');this.center.loading=$a(this.center,'div','',{margin:'200px 0px',fontSize:'14px',color:'#999',textAlign:'center'});this.center.loading.innerHTML='Loading...'}
|
||||
this.center.header=$a(this.center,'div');this.center.body=$a(this.center,'div');this.center.loading=$a(this.center,'div','',{margin:'200px 0px',fontSize:'14px',color:'#999',textAlign:'center'});this.center.loading.innerHTML='Loading...'}
|
||||
this.setup_sidebar_menu=function(){if(this.left_sidebar&&this.cp.show_sidebar_menu){sidebar_menu=new SidebarMenu();sidebar_menu.make_menu('');}}
|
||||
this.run_startup_code=function(){$(document).trigger('startup');try{if(this.cp.custom_startup_code)
|
||||
eval(this.cp.custom_startup_code);}catch(e){errprint(e);}}
|
||||
this.setup=function(){this.cp=wn.control_panel;this.wrapper=$a($i('body_div'),'div');this.body=$a(this.wrapper,'div');this.setup_page_areas();if(user=='Guest')user_defaults.hide_webnotes_toolbar=1;if(!cint(user_defaults.hide_webnotes_toolbar)||user=='Administrator'){this.wntoolbar=new wn.ui.toolbar.Toolbar();}
|
||||
@@ -1799,7 +1801,7 @@ cur_frm.comments.list.dt=cur_frm.doctype;cur_frm.comments.list.dn=cur_frm.docnam
|
||||
if(frm&&frm==cur_frm){frm.set_heading();}}}
|
||||
_f.Frm.prototype.show_comments=function(){if(!cur_frm.comments){cur_frm.comments=new Dialog(540,400,'Comments');cur_frm.comments.comment_body=$a(cur_frm.comments.body,'div','dialog_frm');$y(cur_frm.comments.body,{backgroundColor:'#EEE'});cur_frm.comments.list=new CommentList(cur_frm.comments.comment_body);}
|
||||
cur_frm.comments.list.dt=cur_frm.doctype;cur_frm.comments.list.dn=cur_frm.docname;cur_frm.comments.show();cur_frm.comments.list.run();}
|
||||
/*
|
||||
/*
|
||||
* lib/js/legacy/widgets/form/form_fields.js
|
||||
*/
|
||||
_f.ColumnBreak=function(){this.set_input=function(){};}
|
||||
@@ -2163,7 +2165,6 @@ if(r.dt_labels){for(key in r.dt_labels)session.rev_dt_labels[r.dt_labels[key]]=k
|
||||
/*
|
||||
* lib/js/legacy/app.js
|
||||
*/
|
||||
var popup_cont;var session={};var start_sid=null;if(!wn)var wn={};function startup(){start_sid=get_cookie('sid');popup_cont=$a(document.getElementsByTagName('body')[0],'div');var setup_globals=function(r){wn.boot=r;profile=r.profile;user=r.profile.name;user_fullname=profile.first_name+(r.profile.last_name?(' '+r.profile.last_name):'');user_defaults=profile.defaults;user_roles=profile.roles;user_email=profile.email;profile.start_items=r.start_items;home_page=r.home_page;_p.letter_heads=r.letter_heads;sys_defaults=r.sysdefaults;session.rt=profile.can_read;if(r.ipinfo)session.ipinfo=r.ipinfo;session.dt_labels=r.dt_labels;session.rev_dt_labels={}
|
||||
var popup_cont;var session={};var start_sid=null;if(!wn)var wn={};function startup(){start_sid=get_cookie('sid');popup_cont=$a(document.getElementsByTagName('body')[0],'div');var setup_globals=function(r){wn.boot=r;profile=r.profile;user=r.profile.name;user_fullname=profile.first_name+(r.profile.last_name?(' '+r.profile.last_name):'');user_defaults=profile.defaults;user_roles=profile.roles;user_email=profile.email;profile.start_items=r.start_items;home_page=r.home_page;_p.letter_heads=r.letter_heads;sys_defaults=r.sysdefaults;session.rt=profile.can_read;if(r.ipinfo)session.ipinfo=r.ipinfo;session.dt_labels=r.dt_labels;session.rev_dt_labels={}
|
||||
if(r.dt_labels){for(key in r.dt_labels)session.rev_dt_labels[r.dt_labels[key]]=key;}
|
||||
wn.control_panel=r.control_panel;}
|
||||
@@ -2220,6 +2221,11 @@ $(document).bind('startup',function(){erpnext.startup.start();});
|
||||
var update_messages=function(){if(inList(['Guest','Administrator'],user)){return;}
|
||||
$c_page('home','event_updates','get_unread_messages',null,function(r,rt){if(!r.exc){page_body.wntoolbar.set_new_comments(r.message);}});}
|
||||
erpnext.startup.set_periodic_updates=function(){wn.updates={};if(wn.updates.id){clearInterval(wn.updates.id);}
|
||||
wn.updates.id=setInterval(update_messages,180000);}
|
||||
$(document).bind('startup',function(){erpnext.startup.start();});
|
||||
/*
|
||||
* erpnext/startup/modules.js
|
||||
*/
|
||||
wn.provide('erpnext.module_page');erpnext.module_page.setup_page=function(module,wrapper){erpnext.module_page.hide_links(wrapper);erpnext.module_page.make_list(module,wrapper);$(wrapper).find("a").tooltip({delay:{show:500,hide:100}});}
|
||||
erpnext.module_page.hide_links=function(wrapper){$(wrapper).find('[href*="List/"]').each(function(){var href=$(this).attr('href');var dt=href.split('/')[1];if(wn.boot.profile.can_read.indexOf(get_label_doctype(dt))==-1){var txt=$(this).text();$(this).parent().css('color','#999').html(txt);}});$(wrapper).find('[data-doctype]').each(function(){var dt=$(this).attr('data-doctype');if(wn.boot.profile.can_read.indexOf(dt)==-1){var txt=$(this).text();$(this).parent().css('color','#999').html(txt);}});$(wrapper).find('[href*="Form/"]').each(function(){var href=$(this).attr('href');var dt=href.split('/')[1];if(wn.boot.profile.can_read.indexOf(get_label_doctype(dt))==-1){var txt=$(this).text();$(this).parent().css('color','#999').html(txt);}});}
|
||||
erpnext.module_page.make_list=function(module,wrapper){wrapper.list=new wn.widgets.Listing({parent:$(wrapper).find('.reports-list').get(0),method:'utilities.get_report_list',render_row:function(row,data){if(!data.parent_doc_type)data.parent_doc_type=data.doc_type;$(row).html(repl('<a href="#!Report/%(doc_type)s/%(criteria_name)s" \
|
||||
@@ -2262,7 +2268,7 @@ si.show_section(me.det.doc_type);}}
|
||||
loadpage(label,null,1);}}
|
||||
SidebarModuleItem=function(si,det){this.det=det;var me=this;this.pointer=new MenuPointer(si.items_area,get_doctype_label(det.doc_name));$y(si.items_area,{marginLeft:'32px'})
|
||||
$y($td(this.pointer.tab,0,0),{fontSize:'11px'});this.pointer.wrapper.onclick=function(){if(me.det.doc_type=='Forms')
|
||||
loaddocbrowser(det.doc_name);else
|
||||
loaddocbrowser(det.doc_name);else
|
||||
si.show_section(me.det.doc_type);}}
|
||||
/*
|
||||
* erpnext/startup/toolbar.js
|
||||
@@ -2276,6 +2282,23 @@ $('#toolbar-help').append('<li><a href="http://www.providesupport.com?messenger=
|
||||
$('#toolbar-help').append('<li><a href="http://erpnext.blogspot.com/2011/03/erpnext-help.html" target="_blank">\
|
||||
Documentation</a></li>')
|
||||
$('#toolbar-help').append('<li><a href="http://groups.google.com/group/erpnext-user-forum" target="_blank">\
|
||||
Forum</a></li>')
|
||||
$('#toolbar-help').append('<li><a href="http://www.providesupport.com?messenger=iwebnotes" target="_blank">\
|
||||
Live Chat (Office Hours)</a></li>')
|
||||
if(pscript.is_erpnext_saas&&is_system_manager){$('#toolbar-user').append('<li><a href="#billing">Billing</a></li>')}
|
||||
$.extend(page_body.wntoolbar,{set_new_comments:function(new_comments){var navbar_nc=$('#toolbar-new-comments');if(new_comments&&new_comments.length>0){navbar_nc.html('<span class="navbar-new-comments">'+new_comments.length+'</span>');navbar_nc.click(function(){loadpage('My Company');});$.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.html('');navbar_nc.click(function(){return false;});}}});page_body.wntoolbar.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">\
|
||||
<li><a href="#!accounts-home" data-module="Accounts">Accounts</a></li>\
|
||||
<li><a href="#!selling-home" data-module="Selling">Selling</a></li>\
|
||||
<li><a href="#!stock-home" data-module="Stock">Stock</a></li>\
|
||||
<li><a href="#!buying-home" data-module="Buying">Buying</a></li>\
|
||||
<li><a href="#!support-home" data-module="Support">Support</a></li>\
|
||||
<li><a href="#!hr-home" data-module="HR">Human Resources</a></li>\
|
||||
<li><a href="#!projects-home" data-module="Projects">Projects</a></li>\
|
||||
<li><a href="#!production-home" data-module="Production">Production</a></li>\
|
||||
<li><a href="#!website-home" data-module="Website">Website</a></li>\
|
||||
<li class="divider"></li>\
|
||||
<li><a href="#!Setup" data-module="Setup">Setup</a></li>\
|
||||
|
||||
Reference in New Issue
Block a user