style cleanups and new builds
This commit is contained in:
parent
f86f98c4c6
commit
c8abe5b2ad
@ -10,12 +10,29 @@ html {
|
||||
body {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
font-family: Arial, Helvetica, Sans;
|
||||
font-size: 14px;
|
||||
color: #000;
|
||||
background-color: #e2e2e2;
|
||||
}
|
||||
|
||||
/* font settings */
|
||||
|
||||
h1, h2, h3, h4, h5 {
|
||||
font-family: "Helvetica Neue", Helvetica, "Helvetica Neue", sans-serif;
|
||||
font-weight: normal;
|
||||
margin-top: 0.2em;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "Helvetica Neue", Helvetica, "Helvetica Neue", sans-serif;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
span, div, td, input, textarea, button, select {
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
|
||||
pre { margin: 0px; padding: 0px; }
|
||||
|
||||
button { margin: 2px; margin-left: 0px; }
|
||||
|
@ -10,12 +10,29 @@ html {
|
||||
body {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
font-family: Arial, Helvetica, Sans;
|
||||
font-size: 14px;
|
||||
color: #000;
|
||||
background-color: #e2e2e2;
|
||||
}
|
||||
|
||||
/* font settings */
|
||||
|
||||
h1, h2, h3, h4, h5 {
|
||||
font-family: "Helvetica Neue", Helvetica, "Helvetica Neue", sans-serif;
|
||||
font-weight: normal;
|
||||
margin-top: 0.2em;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "Helvetica Neue", Helvetica, "Helvetica Neue", sans-serif;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
span, div, td, input, textarea, button, select {
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
|
||||
pre { margin: 0px; padding: 0px; }
|
||||
|
||||
button { margin: 2px; margin-left: 0px; }
|
||||
|
@ -1,213 +0,0 @@
|
||||
# DocType, ToDo
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2012-03-27 14:36:47',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-03-27 14:36:47',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all DocType
|
||||
{
|
||||
'allow_attach': 0,
|
||||
'allow_copy': 0,
|
||||
'allow_email': 0,
|
||||
'allow_print': 0,
|
||||
'allow_rename': 0,
|
||||
'allow_trash': 0,
|
||||
'autoname': u'TDI.########',
|
||||
'colour': u'White:FFF',
|
||||
'doctype': 'DocType',
|
||||
'hide_heading': 0,
|
||||
'hide_toolbar': 0,
|
||||
'in_create': 1,
|
||||
'in_dialog': 0,
|
||||
'is_transaction_doc': 0,
|
||||
'issingle': 0,
|
||||
'max_attachments': 0,
|
||||
'module': u'Utilities',
|
||||
'name': '__common__',
|
||||
'read_only': 1,
|
||||
'read_only_onload': 0,
|
||||
'section_style': u'Simple',
|
||||
'server_code_error': u' ',
|
||||
'show_in_menu': 0,
|
||||
'use_template': 0,
|
||||
'version': 5
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'ToDo',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# These values are common for all DocPerm
|
||||
{
|
||||
'create': 1,
|
||||
'doctype': u'DocPerm',
|
||||
'name': '__common__',
|
||||
'parent': u'ToDo',
|
||||
'parentfield': u'permissions',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0,
|
||||
'read': 1,
|
||||
'role': u'All',
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocType, ToDo
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'ToDo'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'doctype': u'DocPerm'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'allow_on_submit': 0,
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'description',
|
||||
'fieldtype': u'Text',
|
||||
'hidden': 0,
|
||||
'in_filter': 0,
|
||||
'label': u'Description',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': u'description',
|
||||
'oldfieldtype': u'Text',
|
||||
'print_hide': 0,
|
||||
'report_hide': 0,
|
||||
'reqd': 0,
|
||||
'search_index': 0,
|
||||
'width': u'300px'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'allow_on_submit': 0,
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'date',
|
||||
'fieldtype': u'Date',
|
||||
'hidden': 0,
|
||||
'in_filter': 0,
|
||||
'label': u'Date',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': u'date',
|
||||
'oldfieldtype': u'Date',
|
||||
'print_hide': 0,
|
||||
'report_hide': 0,
|
||||
'reqd': 0,
|
||||
'search_index': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'allow_on_submit': 0,
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'priority',
|
||||
'fieldtype': u'Data',
|
||||
'hidden': 0,
|
||||
'in_filter': 0,
|
||||
'label': u'Priority',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': u'priority',
|
||||
'oldfieldtype': u'Data',
|
||||
'print_hide': 0,
|
||||
'report_hide': 0,
|
||||
'reqd': 0,
|
||||
'search_index': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'allow_on_submit': 0,
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'reference_type',
|
||||
'fieldtype': u'Data',
|
||||
'hidden': 0,
|
||||
'in_filter': 0,
|
||||
'label': u'Reference Type',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': u'reference_type',
|
||||
'oldfieldtype': u'Data',
|
||||
'print_hide': 0,
|
||||
'report_hide': 0,
|
||||
'reqd': 0,
|
||||
'search_index': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'allow_on_submit': 0,
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'reference_name',
|
||||
'fieldtype': u'Data',
|
||||
'hidden': 0,
|
||||
'in_filter': 0,
|
||||
'label': u'Reference Name',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': u'reference_name',
|
||||
'oldfieldtype': u'Data',
|
||||
'print_hide': 0,
|
||||
'report_hide': 0,
|
||||
'reqd': 0,
|
||||
'search_index': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'allow_on_submit': 0,
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'checked',
|
||||
'fieldtype': u'Check',
|
||||
'hidden': 0,
|
||||
'in_filter': 0,
|
||||
'label': u'Checked',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': u'checked',
|
||||
'oldfieldtype': u'Check',
|
||||
'print_hide': 0,
|
||||
'report_hide': 0,
|
||||
'reqd': 0,
|
||||
'search_index': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'allow_on_submit': 0,
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'role',
|
||||
'fieldtype': u'Link',
|
||||
'hidden': 0,
|
||||
'in_filter': 0,
|
||||
'label': u'Role',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': u'role',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Role',
|
||||
'print_hide': 0,
|
||||
'report_hide': 0,
|
||||
'reqd': 0,
|
||||
'search_index': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'assigned_by',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Assigned By',
|
||||
'options': u'Profile'
|
||||
}
|
||||
]
|
@ -28,13 +28,15 @@ cgitb.enable()
|
||||
|
||||
# import libs
|
||||
sys.path.append('.')
|
||||
|
||||
import conf
|
||||
|
||||
sys.path.append('lib/py')
|
||||
sys.path.append('erpnext')
|
||||
sys.path.append(conf.modules_path)
|
||||
|
||||
import webnotes
|
||||
import webnotes.handler
|
||||
import webnotes.auth
|
||||
import webnotes.defs
|
||||
|
||||
def init():
|
||||
# make the form_dict
|
||||
@ -49,7 +51,7 @@ def init():
|
||||
except webnotes.AuthenticationError, e:
|
||||
return True
|
||||
except webnotes.UnknownDomainError, e:
|
||||
print "Location: " + (webnotes.defs.redirect_404)
|
||||
print "Location: " + (conf.redirect_404)
|
||||
except webnotes.SessionStopped, e:
|
||||
if 'cmd' in webnotes.form_dict:
|
||||
webnotes.handler.print_json()
|
||||
|
@ -262,7 +262,7 @@ this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\
|
||||
</div>\
|
||||
</div>\
|
||||
\
|
||||
<div style="height: 37px; margin-bottom:9px" class="list-toolbar-wrapper">\
|
||||
<div style="margin-bottom:9px" class="list-toolbar-wrapper">\
|
||||
<div class="list-toolbar" style="display:inline-block; margin-right: 10px;">\
|
||||
</div>\
|
||||
<div style="display:inline-block; width: 24px; margin-left: 4px">\
|
||||
@ -289,14 +289,15 @@ if(icon){$('<i>').addClass(icon).appendTo($button);}
|
||||
$button.html(label).click(click);return $button}},show_view:function($btn,$div,$btn_unsel,$div_unsel){$btn_unsel.removeClass('btn-info');$btn_unsel.find('i').removeClass('icon-white');$div_unsel.toggle(false);$btn.addClass('btn-info');$btn.find('i').addClass('icon-white');$div.toggle(true);},set_events:function(){var me=this;this.$w.find('.btn-more').click(function(){me.run({append:true});});if(this.title){this.$w.find('h3').html(this.title).toggle(true);}
|
||||
if(!(this.hide_refresh||this.no_refresh)){this.add_button('Refresh',function(){me.run();},'icon-refresh');}
|
||||
if(this.new_doctype){this.add_button('New '+this.new_doctype,function(){newdoc(me.new_doctype)},'icon-plus');}
|
||||
if(me.show_filters){this.add_button('Show Filters',function(){me.filter_list.show_filters();},'icon-search').addClass('btn-filter');}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
|
||||
if(me.show_filters){this.add_button('Show Filters',function(){me.filter_list.show_filters();},'icon-search').addClass('btn-filter');}
|
||||
if(me.no_toolbar||me.hide_toolbar){me.$w.find('.list-toolbar-wrapper').toggle(false);}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
|
||||
this.onrun=a0;if(a0&&a0.callback)
|
||||
this.onrun=a0.callback;if(!a1&&!(a0&&a0.append))
|
||||
this.start=0;me.set_working(true);wn.call({method:this.opts.method||'webnotes.widgets.query_builder.runquery',args:this.get_call_args(),callback:function(r){me.set_working(false);me.render_results(r)},no_spinner:this.opts.no_loading});},set_working:function(flag){this.$w.find('.img-load').toggle(flag);},get_call_args:function(){if(!this.method){this.query=this.get_query?this.get_query():this.query;this.add_limits();var args={query_max:this.query_max,as_dict:1}
|
||||
this.start=0;me.set_working(true);wn.call({method:this.opts.method||'webnotes.widgets.query_builder.runquery',args:this.get_call_args(a0),callback:function(r){me.set_working(false);me.render_results(r)},no_spinner:this.opts.no_loading});},set_working:function(flag){this.$w.find('.img-load').toggle(flag);},get_call_args:function(opts){if(!this.method){this.query=this.get_query?this.get_query():this.query;this.add_limits();var args={query_max:this.query_max,as_dict:1}
|
||||
args.simple_query=this.query;}else{var args={limit_start:this.start,limit_page_length:this.page_length}}
|
||||
if(this.args)
|
||||
$.extend(args,this.args)
|
||||
if(this.get_args){$.extend(args,this.get_args());}
|
||||
if(this.get_args){$.extend(args,this.get_args(opts));}
|
||||
return args;},render_results:function(r){if(this.start==0)this.clear();this.$w.find('.btn-more').toggle(false);if(r.message)r.values=r.message;if(r.values&&r.values.length){this.data=this.data.concat(r.values);this.render_list(r.values);}else{if(this.start==0){this.$w.find('.result').toggle(false);this.$w.find('.no-result').toggle(true);}}
|
||||
if(this.onrun)this.onrun();if(this.callback)this.callback(r);},render_list:function(values){var m=Math.min(values.length,this.page_length);for(var i=0;i<m;i++){this.render_row(this.add_row(),values[i],this,i);}
|
||||
this.start+=m;if(values.length>=this.page_length)
|
||||
@ -424,9 +425,14 @@ if(data.docstatus==0||data.docstatus==null){data.docstatus_icon='icon-pencil';da
|
||||
/*
|
||||
* lib/js/wn/views/pageview.js
|
||||
*/
|
||||
wn.provide('wn.views.pageview');wn.views.pageview={pages:{},with_page:function(name,callback){if(!locals.Page[name]){wn.call({method:'webnotes.widgets.page.getpage',args:{'name':name},callback:callback});}else{callback();}},show:function(name){wn.views.pageview.with_page(name,function(){if(!wn.pages[name]){wn.views.pageview.pages[name]=new wn.views.Page(name);}
|
||||
wn.provide('wn.views.pageview');wn.views.pageview={pages:{},with_page:function(name,callback){if(!locals.Page[name]){wn.call({method:'webnotes.widgets.page.getpage',args:{'name':name},callback:callback});}else{callback();}},show:function(name){if(!name)name=wn.boot.home_page;wn.views.pageview.with_page(name,function(r){if(r&&r.exc){if(!wn.pages['404'])wn.views.make_404();wn.container.change_to('404');}else if(!wn.pages[name]){wn.views.pageview.pages[name]=new wn.views.Page(name);}
|
||||
wn.container.change_to(name);});}}
|
||||
wn.views.Page=Class.extend({init:function(name){this.name=name;var me=this;this.pagedoc=locals.Page[this.name];this.wrapper=wn.container.add_page(this.name);this.wrapper.label=this.pagedoc.title||this.pagedoc.name;this.wrapper.innerHTML=this.pagedoc.content;wn.dom.eval(this.pagedoc.__script||this.pagedoc.script||'');wn.dom.set_style(this.pagedoc.style);this.trigger('onload');$(this.wrapper).bind('show',function(){cur_frm=null;me.trigger('onshow');me.trigger('refresh');});},trigger:function(eventname){var me=this;try{if(pscript[eventname+'_'+this.name]){pscript[eventname+'_'+this.name](me.wrapper);}else if(me.wrapper[eventname]){me.wrapper[eventname](me.wrapper);}}catch(e){console.log(e);}}})
|
||||
wn.views.make_404=function(){var page=wn.container.add_page('404');$(page).html('<div class="layout-wrapper">\
|
||||
<h1>Not Found</h1><br>\
|
||||
<p>Sorry we were unable to find what you were looking for.</p>\
|
||||
<p><a href="#">Go back to home</a></p>\
|
||||
</div>')};
|
||||
/*
|
||||
* lib/js/wn/views/formview.js
|
||||
*/
|
||||
@ -448,7 +454,7 @@ wn.provide('wn.request');wn.request.url='index.cgi';wn.request.prepare=function(
|
||||
throw"Incomplete Request";}}
|
||||
wn.request.cleanup=function(opts,r){if(opts.btn)$(opts.btn).done_working();if(opts.show_spinner)hide_loading();if(opts.freeze)unfreeze();if(wn.boot.sid&&wn.get_cookie('sid')!=wn.boot.sid){msgprint('Session expired');setTimeout('redirect_to_login()',3000);return;}
|
||||
if(r.server_messages)msgprint(r.server_messages)
|
||||
if(r.exc){errprint(r.exc);console.log(r.exc);};if(r.docs)LocalDB.sync(r.docs);}
|
||||
if(r.exc){console.log(r.exc);};if(r.docs)LocalDB.sync(r.docs);}
|
||||
wn.request.call=function(opts){wn.request.prepare(opts);$.ajax({url:opts.url||wn.request.url,data:opts.args,type:opts.type||'POST',dataType:opts.dataType||'json',success:function(r,xhr){wn.request.cleanup(opts,r);opts.success(r,xhr.responseText);},error:function(xhr,textStatus){wn.request.cleanup(opts,{});show_alert('Unable to complete request: '+textStatus)
|
||||
if(opts.error)opts.error(xhr)}})}
|
||||
wn.call=function(opts){var args=$.extend({},opts.args)
|
||||
@ -458,7 +464,7 @@ wn.request.call({args:args,success:opts.callback,error:opts.error,btn:opts.btn,f
|
||||
/*
|
||||
* lib/js/core.js
|
||||
*/
|
||||
if(!console){var console={log:function(txt){errprint(txt);}}}
|
||||
if(!console){var console={log:function(txt){alert(txt);}}}
|
||||
wn.versions.check();$(document).bind('ready',function(){var base=window.location.href.split('#')[0];$.each($('a[softlink!="false"]'),function(i,v){if(v.href.substr(0,base.length)==base){var path=(v.href.substr(base.length));if(path.substr(0,1)!='#'){v.href=base+'#'+path;}}});if(!wn.settings.no_history&&window.location.hash){wn.page.set(window.location.hash.substr(1));}});
|
||||
|
||||
/*
|
||||
@ -1750,7 +1756,7 @@ this.copy_doc(fn,1);}
|
||||
_f.get_value=function(dt,dn,fn){if(locals[dt]&&locals[dt][dn])
|
||||
return locals[dt][dn][fn];}
|
||||
_f.set_value=function(dt,dn,fn,v){var d=locals[dt][dn];if(!d){console.log('_f.set_value - '+fn+': "'+dt+','+dn+'" not found');return;}
|
||||
var changed=d[fn]!=v;if(changed&&(d[fn]==null||v==null)&&(cstr(d[fn])==cstr(v)))changed=0;if(changed){d[fn]=v;d.__unsaved=1;if(d.parent&&d.parenttype){locals[d.parenttype][d.parent].__unsaved=1;var frm=wn.views.formview[d.parenttype].frm;}else{locals[d.doctype][d.name].__unsaved=1;var frm=wn.views.formview[d.doctype].frm;}
|
||||
var changed=d[fn]!=v;if(changed&&(d[fn]==null||v==null)&&(cstr(d[fn])==cstr(v)))changed=0;if(changed){d[fn]=v;d.__unsaved=1;if(d.parent&&d.parenttype){locals[d.parenttype][d.parent].__unsaved=1;var frm=wn.views.formview[d.parenttype].frm;}else{locals[d.doctype][d.name].__unsaved=1;var frm=wn.views.formview[d.doctype]&&wn.views.formview[d.doctype].frm;}
|
||||
if(frm&&frm==cur_frm&&frm.frm_head){frm.frm_head.refresh_labels();}}}
|
||||
_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();}
|
||||
@ -2128,7 +2134,7 @@ wn.control_panel=r.control_panel;}
|
||||
var setup_viewport=function(){wn.container=new wn.views.Container();if(user=='Guest')
|
||||
user_defaults.hide_webnotes_toolbar=1;if(!cint(user_defaults.hide_webnotes_toolbar)||user=='Administrator'){wn.container.wntoolbar=new wn.ui.toolbar.Toolbar();}
|
||||
$(document).trigger('startup');try{if(wn.control_panel.custom_startup_code)
|
||||
eval(wn.control_panel.custom_startup_code);}catch(e){errprint(e);}
|
||||
eval(wn.control_panel.custom_startup_code);}catch(e){console.log('Error in evaluating custom startup code:');console.log(e);}
|
||||
var t=to_open();if(t){window.location.hash=t;set_favicon();}else if(home_page){loadpage(home_page);}
|
||||
wn.route();$dh('startup_div');$ds('body_div');}
|
||||
var callback=function(r,rt){if(r.exc)console.log(r.exc);setup_globals(r);setup_viewport();}
|
||||
@ -2139,7 +2145,7 @@ msgprint(wn.boot.server_messages);}else{if($i('startup_div'))
|
||||
$c('startup',{},callback,null,1);}}
|
||||
function to_open(){if(get_url_arg('page'))
|
||||
return get_url_arg('page');var h=location.hash;if(h){return h.substr(1);}}
|
||||
function logout(){$c('logout',args={},function(r,rt){if(r.exc){msgprint(r.exc);return;}
|
||||
function logout(){$c('logout',args={},function(r,rt){if(r.exc){console.log(r.exc);return;}
|
||||
redirect_to_login();});}
|
||||
function redirect_to_login(){if(login_file)
|
||||
window.location.href=login_file;else{window.location.reload();}}
|
||||
@ -2170,7 +2176,8 @@ 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','Dashboard':'dashboard'}
|
||||
erpnext.startup.set_globals=function(){pscript.is_erpnext_saas=cint(wn.control_panel.sync_with_gateway)
|
||||
erpnext.startup.set_globals=function(){wn.control_panel.sync_with_gateway=wn.boot.sync_with_gateway
|
||||
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.user_background){erpnext.set_user_background(wn.boot.user_background);}
|
||||
if(user=='Guest'){if(wn.boot.custom_css){set_style(wn.boot.custom_css);}
|
||||
|
@ -149,7 +149,7 @@ this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\
|
||||
</div>\
|
||||
</div>\
|
||||
\
|
||||
<div style="height: 37px; margin-bottom:9px" class="list-toolbar-wrapper">\
|
||||
<div style="margin-bottom:9px" class="list-toolbar-wrapper">\
|
||||
<div class="list-toolbar" style="display:inline-block; margin-right: 10px;">\
|
||||
</div>\
|
||||
<div style="display:inline-block; width: 24px; margin-left: 4px">\
|
||||
@ -176,14 +176,15 @@ if(icon){$('<i>').addClass(icon).appendTo($button);}
|
||||
$button.html(label).click(click);return $button}},show_view:function($btn,$div,$btn_unsel,$div_unsel){$btn_unsel.removeClass('btn-info');$btn_unsel.find('i').removeClass('icon-white');$div_unsel.toggle(false);$btn.addClass('btn-info');$btn.find('i').addClass('icon-white');$div.toggle(true);},set_events:function(){var me=this;this.$w.find('.btn-more').click(function(){me.run({append:true});});if(this.title){this.$w.find('h3').html(this.title).toggle(true);}
|
||||
if(!(this.hide_refresh||this.no_refresh)){this.add_button('Refresh',function(){me.run();},'icon-refresh');}
|
||||
if(this.new_doctype){this.add_button('New '+this.new_doctype,function(){newdoc(me.new_doctype)},'icon-plus');}
|
||||
if(me.show_filters){this.add_button('Show Filters',function(){me.filter_list.show_filters();},'icon-search').addClass('btn-filter');}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
|
||||
if(me.show_filters){this.add_button('Show Filters',function(){me.filter_list.show_filters();},'icon-search').addClass('btn-filter');}
|
||||
if(me.no_toolbar||me.hide_toolbar){me.$w.find('.list-toolbar-wrapper').toggle(false);}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
|
||||
this.onrun=a0;if(a0&&a0.callback)
|
||||
this.onrun=a0.callback;if(!a1&&!(a0&&a0.append))
|
||||
this.start=0;me.set_working(true);wn.call({method:this.opts.method||'webnotes.widgets.query_builder.runquery',args:this.get_call_args(),callback:function(r){me.set_working(false);me.render_results(r)},no_spinner:this.opts.no_loading});},set_working:function(flag){this.$w.find('.img-load').toggle(flag);},get_call_args:function(){if(!this.method){this.query=this.get_query?this.get_query():this.query;this.add_limits();var args={query_max:this.query_max,as_dict:1}
|
||||
this.start=0;me.set_working(true);wn.call({method:this.opts.method||'webnotes.widgets.query_builder.runquery',args:this.get_call_args(a0),callback:function(r){me.set_working(false);me.render_results(r)},no_spinner:this.opts.no_loading});},set_working:function(flag){this.$w.find('.img-load').toggle(flag);},get_call_args:function(opts){if(!this.method){this.query=this.get_query?this.get_query():this.query;this.add_limits();var args={query_max:this.query_max,as_dict:1}
|
||||
args.simple_query=this.query;}else{var args={limit_start:this.start,limit_page_length:this.page_length}}
|
||||
if(this.args)
|
||||
$.extend(args,this.args)
|
||||
if(this.get_args){$.extend(args,this.get_args());}
|
||||
if(this.get_args){$.extend(args,this.get_args(opts));}
|
||||
return args;},render_results:function(r){if(this.start==0)this.clear();this.$w.find('.btn-more').toggle(false);if(r.message)r.values=r.message;if(r.values&&r.values.length){this.data=this.data.concat(r.values);this.render_list(r.values);}else{if(this.start==0){this.$w.find('.result').toggle(false);this.$w.find('.no-result').toggle(true);}}
|
||||
if(this.onrun)this.onrun();if(this.callback)this.callback(r);},render_list:function(values){var m=Math.min(values.length,this.page_length);for(var i=0;i<m;i++){this.render_row(this.add_row(),values[i],this,i);}
|
||||
this.start+=m;if(values.length>=this.page_length)
|
||||
@ -311,9 +312,14 @@ if(data.docstatus==0||data.docstatus==null){data.docstatus_icon='icon-pencil';da
|
||||
/*
|
||||
* lib/js/wn/views/pageview.js
|
||||
*/
|
||||
wn.provide('wn.views.pageview');wn.views.pageview={pages:{},with_page:function(name,callback){if(!locals.Page[name]){wn.call({method:'webnotes.widgets.page.getpage',args:{'name':name},callback:callback});}else{callback();}},show:function(name){wn.views.pageview.with_page(name,function(){if(!wn.pages[name]){wn.views.pageview.pages[name]=new wn.views.Page(name);}
|
||||
wn.provide('wn.views.pageview');wn.views.pageview={pages:{},with_page:function(name,callback){if(!locals.Page[name]){wn.call({method:'webnotes.widgets.page.getpage',args:{'name':name},callback:callback});}else{callback();}},show:function(name){if(!name)name=wn.boot.home_page;wn.views.pageview.with_page(name,function(r){if(r&&r.exc){if(!wn.pages['404'])wn.views.make_404();wn.container.change_to('404');}else if(!wn.pages[name]){wn.views.pageview.pages[name]=new wn.views.Page(name);}
|
||||
wn.container.change_to(name);});}}
|
||||
wn.views.Page=Class.extend({init:function(name){this.name=name;var me=this;this.pagedoc=locals.Page[this.name];this.wrapper=wn.container.add_page(this.name);this.wrapper.label=this.pagedoc.title||this.pagedoc.name;this.wrapper.innerHTML=this.pagedoc.content;wn.dom.eval(this.pagedoc.__script||this.pagedoc.script||'');wn.dom.set_style(this.pagedoc.style);this.trigger('onload');$(this.wrapper).bind('show',function(){cur_frm=null;me.trigger('onshow');me.trigger('refresh');});},trigger:function(eventname){var me=this;try{if(pscript[eventname+'_'+this.name]){pscript[eventname+'_'+this.name](me.wrapper);}else if(me.wrapper[eventname]){me.wrapper[eventname](me.wrapper);}}catch(e){console.log(e);}}})
|
||||
wn.views.make_404=function(){var page=wn.container.add_page('404');$(page).html('<div class="layout-wrapper">\
|
||||
<h1>Not Found</h1><br>\
|
||||
<p>Sorry we were unable to find what you were looking for.</p>\
|
||||
<p><a href="#">Go back to home</a></p>\
|
||||
</div>')};
|
||||
/*
|
||||
* lib/js/wn/views/formview.js
|
||||
*/
|
||||
@ -335,7 +341,7 @@ wn.provide('wn.request');wn.request.url='index.cgi';wn.request.prepare=function(
|
||||
throw"Incomplete Request";}}
|
||||
wn.request.cleanup=function(opts,r){if(opts.btn)$(opts.btn).done_working();if(opts.show_spinner)hide_loading();if(opts.freeze)unfreeze();if(wn.boot.sid&&wn.get_cookie('sid')!=wn.boot.sid){msgprint('Session expired');setTimeout('redirect_to_login()',3000);return;}
|
||||
if(r.server_messages)msgprint(r.server_messages)
|
||||
if(r.exc){errprint(r.exc);console.log(r.exc);};if(r.docs)LocalDB.sync(r.docs);}
|
||||
if(r.exc){console.log(r.exc);};if(r.docs)LocalDB.sync(r.docs);}
|
||||
wn.request.call=function(opts){wn.request.prepare(opts);$.ajax({url:opts.url||wn.request.url,data:opts.args,type:opts.type||'POST',dataType:opts.dataType||'json',success:function(r,xhr){wn.request.cleanup(opts,r);opts.success(r,xhr.responseText);},error:function(xhr,textStatus){wn.request.cleanup(opts,{});show_alert('Unable to complete request: '+textStatus)
|
||||
if(opts.error)opts.error(xhr)}})}
|
||||
wn.call=function(opts){var args=$.extend({},opts.args)
|
||||
@ -345,7 +351,7 @@ wn.request.call({args:args,success:opts.callback,error:opts.error,btn:opts.btn,f
|
||||
/*
|
||||
* lib/js/core.js
|
||||
*/
|
||||
if(!console){var console={log:function(txt){errprint(txt);}}}
|
||||
if(!console){var console={log:function(txt){alert(txt);}}}
|
||||
wn.versions.check();$(document).bind('ready',function(){var base=window.location.href.split('#')[0];$.each($('a[softlink!="false"]'),function(i,v){if(v.href.substr(0,base.length)==base){var path=(v.href.substr(base.length));if(path.substr(0,1)!='#'){v.href=base+'#'+path;}}});if(!wn.settings.no_history&&window.location.hash){wn.page.set(window.location.hash.substr(1));}});
|
||||
|
||||
/*
|
||||
@ -643,7 +649,7 @@ this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\
|
||||
</div>\
|
||||
</div>\
|
||||
\
|
||||
<div style="height: 37px; margin-bottom:9px" class="list-toolbar-wrapper">\
|
||||
<div style="margin-bottom:9px" class="list-toolbar-wrapper">\
|
||||
<div class="list-toolbar" style="display:inline-block; margin-right: 10px;">\
|
||||
</div>\
|
||||
<div style="display:inline-block; width: 24px; margin-left: 4px">\
|
||||
@ -670,14 +676,15 @@ if(icon){$('<i>').addClass(icon).appendTo($button);}
|
||||
$button.html(label).click(click);return $button}},show_view:function($btn,$div,$btn_unsel,$div_unsel){$btn_unsel.removeClass('btn-info');$btn_unsel.find('i').removeClass('icon-white');$div_unsel.toggle(false);$btn.addClass('btn-info');$btn.find('i').addClass('icon-white');$div.toggle(true);},set_events:function(){var me=this;this.$w.find('.btn-more').click(function(){me.run({append:true});});if(this.title){this.$w.find('h3').html(this.title).toggle(true);}
|
||||
if(!(this.hide_refresh||this.no_refresh)){this.add_button('Refresh',function(){me.run();},'icon-refresh');}
|
||||
if(this.new_doctype){this.add_button('New '+this.new_doctype,function(){newdoc(me.new_doctype)},'icon-plus');}
|
||||
if(me.show_filters){this.add_button('Show Filters',function(){me.filter_list.show_filters();},'icon-search').addClass('btn-filter');}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
|
||||
if(me.show_filters){this.add_button('Show Filters',function(){me.filter_list.show_filters();},'icon-search').addClass('btn-filter');}
|
||||
if(me.no_toolbar||me.hide_toolbar){me.$w.find('.list-toolbar-wrapper').toggle(false);}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
|
||||
this.onrun=a0;if(a0&&a0.callback)
|
||||
this.onrun=a0.callback;if(!a1&&!(a0&&a0.append))
|
||||
this.start=0;me.set_working(true);wn.call({method:this.opts.method||'webnotes.widgets.query_builder.runquery',args:this.get_call_args(),callback:function(r){me.set_working(false);me.render_results(r)},no_spinner:this.opts.no_loading});},set_working:function(flag){this.$w.find('.img-load').toggle(flag);},get_call_args:function(){if(!this.method){this.query=this.get_query?this.get_query():this.query;this.add_limits();var args={query_max:this.query_max,as_dict:1}
|
||||
this.start=0;me.set_working(true);wn.call({method:this.opts.method||'webnotes.widgets.query_builder.runquery',args:this.get_call_args(a0),callback:function(r){me.set_working(false);me.render_results(r)},no_spinner:this.opts.no_loading});},set_working:function(flag){this.$w.find('.img-load').toggle(flag);},get_call_args:function(opts){if(!this.method){this.query=this.get_query?this.get_query():this.query;this.add_limits();var args={query_max:this.query_max,as_dict:1}
|
||||
args.simple_query=this.query;}else{var args={limit_start:this.start,limit_page_length:this.page_length}}
|
||||
if(this.args)
|
||||
$.extend(args,this.args)
|
||||
if(this.get_args){$.extend(args,this.get_args());}
|
||||
if(this.get_args){$.extend(args,this.get_args(opts));}
|
||||
return args;},render_results:function(r){if(this.start==0)this.clear();this.$w.find('.btn-more').toggle(false);if(r.message)r.values=r.message;if(r.values&&r.values.length){this.data=this.data.concat(r.values);this.render_list(r.values);}else{if(this.start==0){this.$w.find('.result').toggle(false);this.$w.find('.no-result').toggle(true);}}
|
||||
if(this.onrun)this.onrun();if(this.callback)this.callback(r);},render_list:function(values){var m=Math.min(values.length,this.page_length);for(var i=0;i<m;i++){this.render_row(this.add_row(),values[i],this,i);}
|
||||
this.start+=m;if(values.length>=this.page_length)
|
||||
@ -836,7 +843,7 @@ wn.control_panel=r.control_panel;}
|
||||
var setup_viewport=function(){wn.container=new wn.views.Container();if(user=='Guest')
|
||||
user_defaults.hide_webnotes_toolbar=1;if(!cint(user_defaults.hide_webnotes_toolbar)||user=='Administrator'){wn.container.wntoolbar=new wn.ui.toolbar.Toolbar();}
|
||||
$(document).trigger('startup');try{if(wn.control_panel.custom_startup_code)
|
||||
eval(wn.control_panel.custom_startup_code);}catch(e){errprint(e);}
|
||||
eval(wn.control_panel.custom_startup_code);}catch(e){console.log('Error in evaluating custom startup code:');console.log(e);}
|
||||
var t=to_open();if(t){window.location.hash=t;set_favicon();}else if(home_page){loadpage(home_page);}
|
||||
wn.route();$dh('startup_div');$ds('body_div');}
|
||||
var callback=function(r,rt){if(r.exc)console.log(r.exc);setup_globals(r);setup_viewport();}
|
||||
@ -847,7 +854,7 @@ msgprint(wn.boot.server_messages);}else{if($i('startup_div'))
|
||||
$c('startup',{},callback,null,1);}}
|
||||
function to_open(){if(get_url_arg('page'))
|
||||
return get_url_arg('page');var h=location.hash;if(h){return h.substr(1);}}
|
||||
function logout(){$c('logout',args={},function(r,rt){if(r.exc){msgprint(r.exc);return;}
|
||||
function logout(){$c('logout',args={},function(r,rt){if(r.exc){console.log(r.exc);return;}
|
||||
redirect_to_login();});}
|
||||
function redirect_to_login(){if(login_file)
|
||||
window.location.href=login_file;else{window.location.reload();}}
|
||||
@ -878,7 +885,8 @@ 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','Dashboard':'dashboard'}
|
||||
erpnext.startup.set_globals=function(){pscript.is_erpnext_saas=cint(wn.control_panel.sync_with_gateway)
|
||||
erpnext.startup.set_globals=function(){wn.control_panel.sync_with_gateway=wn.boot.sync_with_gateway
|
||||
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.user_background){erpnext.set_user_background(wn.boot.user_background);}
|
||||
if(user=='Guest'){if(wn.boot.custom_css){set_style(wn.boot.custom_css);}
|
||||
|
16
js/app.js
16
js/app.js
@ -1,19 +1,3 @@
|
||||
// ERPNext - web based ERP (http://erpnext.com)
|
||||
// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
wn.app = {
|
||||
name: 'ERPNext',
|
||||
license: 'GNU/GPL - Usage Condition: All "erpnext" branding must be kept as it is',
|
||||
|
Loading…
x
Reference in New Issue
Block a user