Merge branch 'shf_rename' of github.com:webnotes/erpnext into shf_rename
This commit is contained in:
commit
b1f46c80b2
@ -1937,12 +1937,12 @@ body {
|
||||
/* font settings */
|
||||
|
||||
h1, h2, h3, h4, h5 {
|
||||
font-family: "Helvetica Neue", Helvetica, "Helvetica Neue", sans-serif;
|
||||
font-family: Arial, sans-serif;
|
||||
margin-top: 0.2em;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "Helvetica Neue", Helvetica, "Helvetica Neue", sans-serif;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 13px;
|
||||
background-color: #eee;
|
||||
}
|
||||
@ -3783,12 +3783,12 @@ div.appframe-toolbar {
|
||||
* erpnext/startup/startup.css
|
||||
*/
|
||||
h1, h2, h3, h4, h5 {
|
||||
font-family: "Helvetica Neue", "Open Sans", Helvetica, sans-serif;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
margin-top: 0.2em;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "Helvetica Neue", "Open Sans", Helvetica, sans-serif;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
|
@ -1798,12 +1798,12 @@ body {
|
||||
/* font settings */
|
||||
|
||||
h1, h2, h3, h4, h5 {
|
||||
font-family: "Helvetica Neue", Helvetica, "Helvetica Neue", sans-serif;
|
||||
font-family: Arial, sans-serif;
|
||||
margin-top: 0.2em;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "Helvetica Neue", Helvetica, "Helvetica Neue", sans-serif;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 13px;
|
||||
background-color: #eee;
|
||||
}
|
||||
@ -2481,12 +2481,12 @@ div.appframe-toolbar {
|
||||
* erpnext/startup/startup.css
|
||||
*/
|
||||
h1, h2, h3, h4, h5 {
|
||||
font-family: "Helvetica Neue", "Open Sans", Helvetica, sans-serif;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
margin-top: 0.2em;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "Helvetica Neue", "Open Sans", Helvetica, sans-serif;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
|
@ -173,7 +173,6 @@ cur_frm.cscript.warehouse = function(doc, cdt , cdn) {
|
||||
|
||||
//Customer
|
||||
cur_frm.cscript.customer = function(doc,dt,dn,onload) {
|
||||
|
||||
var callback = function(r,rt) {
|
||||
var callback2 = function(doc, dt, dn) {
|
||||
doc = locals[dt][dn];
|
||||
@ -181,7 +180,7 @@ cur_frm.cscript.customer = function(doc,dt,dn,onload) {
|
||||
get_server_fields('get_cust_and_due_date','','',doc,dt,dn,1,
|
||||
function(doc, dt, dn) {
|
||||
cur_frm.refresh();
|
||||
cur_frm.cscript.price_list_name(doc, dt, dn);
|
||||
if (!onload) cur_frm.cscript.price_list_name(doc, dt, dn);
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
{
|
||||
'creation': '2012-04-13 11:56:18',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-05-01 12:15:53',
|
||||
'modified': '2012-05-02 09:57:50',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
@ -197,6 +197,23 @@
|
||||
'trigger': u'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'customer',
|
||||
'fieldtype': u'Link',
|
||||
'hidden': 0,
|
||||
'label': u'Customer',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': u'customer',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Customer',
|
||||
'permlevel': 0,
|
||||
'print_hide': 1,
|
||||
'trigger': u'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
@ -962,23 +979,6 @@
|
||||
'width': u'50%'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'customer',
|
||||
'fieldtype': u'Link',
|
||||
'hidden': 0,
|
||||
'label': u'Customer',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': u'customer',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Customer',
|
||||
'permlevel': 0,
|
||||
'print_hide': 1,
|
||||
'trigger': u'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
|
0
erpnext/patches/may_2012/__init__.py
Normal file
0
erpnext/patches/may_2012/__init__.py
Normal file
5
erpnext/patches/may_2012/cleanup_property_setter.py
Normal file
5
erpnext/patches/may_2012/cleanup_property_setter.py
Normal file
@ -0,0 +1,5 @@
|
||||
def execute():
|
||||
import webnotes
|
||||
webnotes.conn.sql("delete from `tabProperty Setter` where property in ('width', 'previous_field')")
|
||||
|
||||
webnotes.conn.sql("delete from `tabSingles` where field = 'footer_font_color' and doctype = 'Style Settings'")
|
@ -312,5 +312,10 @@ patch_list = [
|
||||
'patch_file': 'repost_stock_for_posting_time',
|
||||
'description': 'repost stock for posting time 00:00:seconds'
|
||||
},
|
||||
{
|
||||
'patch_module': 'patches.may_2012',
|
||||
'patch_file': 'cleanup_property_setter',
|
||||
'description': 'cleanup_property_setter'
|
||||
},
|
||||
|
||||
]
|
||||
|
@ -102,7 +102,7 @@ cur_frm.cscript.customer = function(doc,dt,dn) {
|
||||
var callback2 = function(r, rt) {
|
||||
if(doc.customer) unhide_field(['customer_address', 'contact_person', 'territory','customer_group','shipping_address']);
|
||||
cur_frm.refresh();
|
||||
cur_frm.cscript.price_list_name(doc, dt, dn);
|
||||
if(!onload) cur_frm.cscript.price_list_name(doc, dt, dn);
|
||||
|
||||
}
|
||||
var doc = locals[cur_frm.doctype][cur_frm.docname];
|
||||
|
@ -1,10 +1,10 @@
|
||||
h1, h2, h3, h4, h5 {
|
||||
font-family: "Helvetica Neue", "Open Sans", Helvetica, sans-serif;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
margin-top: 0.2em;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "Helvetica Neue", "Open Sans", Helvetica, sans-serif;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ cur_frm.cscript.customer = function(doc,dt,dn,onload) {
|
||||
var doc = locals[cur_frm.doctype][cur_frm.docname];
|
||||
if(doc.customer) unhide_field(['customer_address','contact_person','territory','customer_group']);
|
||||
cur_frm.refresh();
|
||||
cur_frm.cscript.price_list_name(doc, dt, dn);
|
||||
if(!onload) cur_frm.cscript.price_list_name(doc, dt, dn);
|
||||
}
|
||||
var args = onload ? 'onload':''
|
||||
if(doc.customer) $c_obj(make_doclist(doc.doctype, doc.name), 'get_default_customer_shipping_address', args, callback);
|
||||
|
@ -48,6 +48,7 @@ $.extend(cur_frm.cscript, {
|
||||
},
|
||||
|
||||
refresh: function(doc) {
|
||||
erpnext.hide_naming_series();
|
||||
cur_frm.cscript.make_listing(doc);
|
||||
if(!doc.__islocal) {
|
||||
if(in_list(user_roles,'System Manager')) {
|
||||
|
@ -3,9 +3,9 @@
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2012-03-27 14:36:43',
|
||||
'creation': '2012-04-02 16:02:42',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-03-27 14:36:43',
|
||||
'modified': '2012-05-02 11:33:24',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
@ -26,7 +26,7 @@
|
||||
'show_in_menu': 0,
|
||||
'subject': u'%(subject)s',
|
||||
'tag_fields': u'status,allocated_to',
|
||||
'version': 153
|
||||
'version': 1
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
@ -41,6 +41,7 @@
|
||||
# These values are common for all DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'name': '__common__',
|
||||
'parent': u'Support Ticket',
|
||||
@ -58,7 +59,6 @@
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 1,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
@ -68,7 +68,6 @@
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 1,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
@ -78,7 +77,6 @@
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 1,
|
||||
'create': 1,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
@ -88,7 +86,6 @@
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
@ -98,7 +95,6 @@
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 2,
|
||||
@ -106,6 +102,21 @@
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'naming_series',
|
||||
'fieldtype': u'Select',
|
||||
'hidden': 0,
|
||||
'label': u'Naming Series',
|
||||
'no_copy': 1,
|
||||
'options': u'SUP',
|
||||
'permlevel': 0,
|
||||
'print_hide': 1,
|
||||
'reqd': 0,
|
||||
'search_index': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
@ -396,20 +407,5 @@
|
||||
'no_copy': 1,
|
||||
'permlevel': 0,
|
||||
'print_hide': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'naming_series',
|
||||
'fieldtype': u'Select',
|
||||
'hidden': 1,
|
||||
'label': u'Series',
|
||||
'no_copy': 1,
|
||||
'options': u'SUP',
|
||||
'permlevel': 0,
|
||||
'print_hide': 1,
|
||||
'reqd': 0,
|
||||
'search_index': 0
|
||||
}
|
||||
]
|
@ -54,9 +54,7 @@ erpnext.navbar.Navbar = Class.extend({
|
||||
for(var i=0;i<items.length;i++) {
|
||||
var item = items[i];
|
||||
if(!item.parent_label && item.parentfield=='top_bar_items') {
|
||||
console.log(item)
|
||||
erpnext.header_link_settings(item);
|
||||
|
||||
$('header .nav:first').append(repl('<li data-label="%(label)s">\
|
||||
<a href="%(route)s" %(target)s>%(label)s</a></li>', item));
|
||||
}
|
||||
@ -120,7 +118,7 @@ erpnext.Footer = Class.extend({
|
||||
// customize hard / soft links
|
||||
erpnext.header_link_settings = function(item) {
|
||||
item.route = item.url || item.custom_page;
|
||||
if(item.route.substr(0,4)=='http') {
|
||||
if(item.route && item.route.substr(0,4)=='http') {
|
||||
item.target = 'target="_blank"';
|
||||
} else {
|
||||
item.target = '';
|
||||
|
@ -271,7 +271,7 @@ wn.get_route_str=function(route){if(!route)
|
||||
route=window.location.hash;if(route.substr(0,1)=='#')route=route.substr(1);if(route.substr(0,1)=='!')route=route.substr(1);return route;}
|
||||
wn.set_route=function(){route=$.map(arguments,function(a){return encodeURIComponent(a)}).join('/');window.location.hash=route;wn.app.set_favicon();}
|
||||
wn._cur_route=null;$(window).bind('hashchange',function(){if(location.hash==wn._cur_route)
|
||||
return;wn.route();if(wn.boot.analytics_code){try{eval(wn.boot.analytics_code);}catch(e){console.log(e);}}});
|
||||
return;wn.route();});
|
||||
/*
|
||||
* lib/js/wn/ui/listing.js
|
||||
*/
|
||||
@ -517,7 +517,8 @@ me.list.run();});this.dialog.show();},add_column:function(c){var w=$('<div style
|
||||
*/
|
||||
wn.provide('wn.request');wn.request.url='index.cgi';wn.request.prepare=function(opts){if(opts.btn)$(opts.btn).set_working();if(opts.show_spinner)set_loading();if(opts.freeze)freeze();if(!opts.args.cmd){console.log(opts)
|
||||
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. Logging you out');wn.app.logout();return;}
|
||||
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. Logging you out');if(!wn.app.logged_out)
|
||||
wn.app.logout();return;}
|
||||
if(r.server_messages)msgprint(r.server_messages)
|
||||
if(r.exc){console.log(r.exc);};if(r['403']){wn.container.change_to('403');}
|
||||
if(r.docs)LocalDB.sync(r.docs);}
|
||||
@ -530,7 +531,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){alert(txt);}}}
|
||||
if(!console){var console={log:function(txt){}}}
|
||||
wn.versions.check();$(document).bind('ready',function(){wn.provide('wn.app');$.extend(wn.app,new wn.Application());});
|
||||
|
||||
/*
|
||||
@ -869,20 +870,19 @@ return v;};function LinkField(){}LinkField.prototype=new Field();LinkField.proto
|
||||
$(me.btn2).css('display','inline-block');else $dh(me.btn2);}}
|
||||
me.txt.field_object=this;me.input.set_input=function(val){if(val==undefined)val='';me.txt.value=val;}
|
||||
me.get_value=function(){return me.txt.value;}
|
||||
$(me.txt).autocomplete({source:function(request,response){wn.call({method:'webnotes.widgets.search.search_link',args:{'txt':request.term,'dt':me.df.options,'query':me.get_custom_query()},callback:function(r){response(r.results);},});},select:function(event,ui){me.set_input_value(ui.item.value);}}).data('autocomplete')._renderItem=function(ul,item){return $('<li></li>').data('item.autocomplete',item).append(repl('<a>%(label)s<br><span style="font-size:10px">%(info)s</span></a>',item)).appendTo(ul);};$(this.txt).change(function(){if(!$(this).val())
|
||||
me.set_input_value('');})}
|
||||
$(me.txt).autocomplete({source:function(request,response){wn.call({method:'webnotes.widgets.search.search_link',args:{'txt':request.term,'dt':me.df.options,'query':me.get_custom_query()},callback:function(r){response(r.results);},});},select:function(event,ui){me.set_input_value(ui.item.value);}}).data('autocomplete')._renderItem=function(ul,item){return $('<li></li>').data('item.autocomplete',item).append(repl('<a>%(label)s<br><span style="font-size:10px">%(info)s</span></a>',item)).appendTo(ul);};$(this.txt).change(function(){if(!$(this).val()){if(selector&&selector.display)return;me.set_input_value('');}})}
|
||||
LinkField.prototype.get_custom_query=function(){this.set_get_query();if(this.get_query){if(cur_frm)
|
||||
var doc=locals[cur_frm.doctype][cur_frm.docname];return this.get_query(doc,this.doctype,this.docname);}}
|
||||
LinkField.prototype.setup_buttons=function(){var me=this;me.btn.onclick=function(){selector.set(me,me.df.options,me.df.label);selector.show(me.txt);}
|
||||
if(me.btn1)me.btn1.onclick=function(){if(me.txt.value&&me.df.options){loaddoc(me.df.options,me.txt.value);}}
|
||||
me.can_create=0;if((!me.not_in_form)&&in_list(profile.can_create,me.df.options)){me.can_create=1;me.btn2.onclick=function(){var on_save_callback=function(new_rec){if(new_rec){var d=_f.calling_doc_stack.pop();locals[d[0]][d[1]][me.df.fieldname]=new_rec;me.refresh();if(me.grid)me.grid.refresh();me.run_trigger();}}
|
||||
_f.calling_doc_stack.push([me.doctype,me.docname]);new_doc(me.df.options,me.on_new,1,on_save_callback,me.doctype,me.docname,me.frm.not_in_container);}}else{$dh(me.btn2);$y($td(me.tab,0,2),{width:'0px'});}}
|
||||
LinkField.prototype.set_input_value=function(val){var me=this;me.refresh_label_icon();if(me.not_in_form){$(this.txt).val(val);return;}
|
||||
LinkField.prototype.set_input_value=function(val){var me=this;var from_selector=false;if(selector&&selector.display)from_selector=true;me.refresh_label_icon();if(me.not_in_form){$(this.txt).val(val);return;}
|
||||
if(cur_frm){if(val==locals[me.doctype][me.docname][me.df.fieldname]){me.set(val);me.run_trigger();return;}}
|
||||
me.set(val);if(_f.cur_grid_cell)
|
||||
_f.cur_grid_cell.grid.cell_deselect();if(!val){me.run_trigger();return;}
|
||||
var fetch='';if(cur_frm.fetch_dict[me.df.fieldname])
|
||||
fetch=cur_frm.fetch_dict[me.df.fieldname].columns.join(', ');$c('webnotes.widgets.form.utils.validate_link',{'value':val,'options':me.df.options,'fetch':fetch},function(r,rt){if(selector&&selector.display)return;if(r.message=='Ok'){if($(me.txt).val()!=val){me.set_input(val);}
|
||||
fetch=cur_frm.fetch_dict[me.df.fieldname].columns.join(', ');$c('webnotes.widgets.form.utils.validate_link',{'value':val,'options':me.df.options,'fetch':fetch},function(r,rt){if(r.message=='Ok'){if($(me.txt).val()!=val&&!from_selector){me.set_input_value(val);}
|
||||
if(r.fetch_values)
|
||||
me.set_fetch_values(r.fetch_values);me.run_trigger();}else{var astr='';if(in_list(profile.can_create,me.df.options))astr=repl('<br><br><span class="link_type" onclick="newdoc(\'%(dt)s\')">Click here</span> to create a new %(dtl)s',{dt:me.df.options,dtl:get_doctype_label(me.df.options)})
|
||||
msgprint(repl('error:<b>%(val)s</b> is not a valid %(dt)s.<br><br>You must first create a new %(dt)s <b>%(val)s</b> and then select its value. To find an existing %(dt)s, click on the magnifying glass next to the field.%(add)s',{val:me.txt.value,dt:get_doctype_label(me.df.options),add:astr}));me.txt.value='';me.set('');}});}
|
||||
@ -1553,20 +1553,19 @@ return v;};function LinkField(){}LinkField.prototype=new Field();LinkField.proto
|
||||
$(me.btn2).css('display','inline-block');else $dh(me.btn2);}}
|
||||
me.txt.field_object=this;me.input.set_input=function(val){if(val==undefined)val='';me.txt.value=val;}
|
||||
me.get_value=function(){return me.txt.value;}
|
||||
$(me.txt).autocomplete({source:function(request,response){wn.call({method:'webnotes.widgets.search.search_link',args:{'txt':request.term,'dt':me.df.options,'query':me.get_custom_query()},callback:function(r){response(r.results);},});},select:function(event,ui){me.set_input_value(ui.item.value);}}).data('autocomplete')._renderItem=function(ul,item){return $('<li></li>').data('item.autocomplete',item).append(repl('<a>%(label)s<br><span style="font-size:10px">%(info)s</span></a>',item)).appendTo(ul);};$(this.txt).change(function(){if(!$(this).val())
|
||||
me.set_input_value('');})}
|
||||
$(me.txt).autocomplete({source:function(request,response){wn.call({method:'webnotes.widgets.search.search_link',args:{'txt':request.term,'dt':me.df.options,'query':me.get_custom_query()},callback:function(r){response(r.results);},});},select:function(event,ui){me.set_input_value(ui.item.value);}}).data('autocomplete')._renderItem=function(ul,item){return $('<li></li>').data('item.autocomplete',item).append(repl('<a>%(label)s<br><span style="font-size:10px">%(info)s</span></a>',item)).appendTo(ul);};$(this.txt).change(function(){if(!$(this).val()){if(selector&&selector.display)return;me.set_input_value('');}})}
|
||||
LinkField.prototype.get_custom_query=function(){this.set_get_query();if(this.get_query){if(cur_frm)
|
||||
var doc=locals[cur_frm.doctype][cur_frm.docname];return this.get_query(doc,this.doctype,this.docname);}}
|
||||
LinkField.prototype.setup_buttons=function(){var me=this;me.btn.onclick=function(){selector.set(me,me.df.options,me.df.label);selector.show(me.txt);}
|
||||
if(me.btn1)me.btn1.onclick=function(){if(me.txt.value&&me.df.options){loaddoc(me.df.options,me.txt.value);}}
|
||||
me.can_create=0;if((!me.not_in_form)&&in_list(profile.can_create,me.df.options)){me.can_create=1;me.btn2.onclick=function(){var on_save_callback=function(new_rec){if(new_rec){var d=_f.calling_doc_stack.pop();locals[d[0]][d[1]][me.df.fieldname]=new_rec;me.refresh();if(me.grid)me.grid.refresh();me.run_trigger();}}
|
||||
_f.calling_doc_stack.push([me.doctype,me.docname]);new_doc(me.df.options,me.on_new,1,on_save_callback,me.doctype,me.docname,me.frm.not_in_container);}}else{$dh(me.btn2);$y($td(me.tab,0,2),{width:'0px'});}}
|
||||
LinkField.prototype.set_input_value=function(val){var me=this;me.refresh_label_icon();if(me.not_in_form){$(this.txt).val(val);return;}
|
||||
LinkField.prototype.set_input_value=function(val){var me=this;var from_selector=false;if(selector&&selector.display)from_selector=true;me.refresh_label_icon();if(me.not_in_form){$(this.txt).val(val);return;}
|
||||
if(cur_frm){if(val==locals[me.doctype][me.docname][me.df.fieldname]){me.set(val);me.run_trigger();return;}}
|
||||
me.set(val);if(_f.cur_grid_cell)
|
||||
_f.cur_grid_cell.grid.cell_deselect();if(!val){me.run_trigger();return;}
|
||||
var fetch='';if(cur_frm.fetch_dict[me.df.fieldname])
|
||||
fetch=cur_frm.fetch_dict[me.df.fieldname].columns.join(', ');$c('webnotes.widgets.form.utils.validate_link',{'value':val,'options':me.df.options,'fetch':fetch},function(r,rt){if(selector&&selector.display)return;if(r.message=='Ok'){if($(me.txt).val()!=val){me.set_input(val);}
|
||||
fetch=cur_frm.fetch_dict[me.df.fieldname].columns.join(', ');$c('webnotes.widgets.form.utils.validate_link',{'value':val,'options':me.df.options,'fetch':fetch},function(r,rt){if(r.message=='Ok'){if($(me.txt).val()!=val&&!from_selector){me.set_input_value(val);}
|
||||
if(r.fetch_values)
|
||||
me.set_fetch_values(r.fetch_values);me.run_trigger();}else{var astr='';if(in_list(profile.can_create,me.df.options))astr=repl('<br><br><span class="link_type" onclick="newdoc(\'%(dt)s\')">Click here</span> to create a new %(dtl)s',{dt:me.df.options,dtl:get_doctype_label(me.df.options)})
|
||||
msgprint(repl('error:<b>%(val)s</b> is not a valid %(dt)s.<br><br>You must first create a new %(dt)s <b>%(val)s</b> and then select its value. To find an existing %(dt)s, click on the magnifying glass next to the field.%(add)s',{val:me.txt.value,dt:get_doctype_label(me.df.options),add:astr}));me.txt.value='';me.set('');}});}
|
||||
@ -1686,7 +1685,8 @@ d.cur_frm=f;d.dn=dn;d.table_form=f.meta.istable;f.refresh(dn);$(f.page_layout.wr
|
||||
*/
|
||||
_f.FrmHeader=Class.extend({init:function(parent,frm){this.appframe=new wn.ui.AppFrame(parent)
|
||||
this.appframe.$titlebar.append('<span class="label-area"></span>\
|
||||
<span class="breadcrumb-area"></span>');this.$w=this.appframe.$w;},refresh:function(){wn.views.breadcrumbs($(this.$w.find('.breadcrumb-area')),cur_frm.meta.module,cur_frm.meta.name,cur_frm.docname);this.refresh_labels();this.refresh_toolbar();},refresh_labels:function(){var labinfo={0:['Draft',''],1:['Submitted','label-info'],2:['Cancelled','label-important']}[cint(cur_frm.doc.docstatus)];if(cur_frm.doc.__unsaved){labinfo[1]='label-warning'}
|
||||
<span class="breadcrumb-area"></span>');this.$w=this.appframe.$w;},refresh:function(){wn.views.breadcrumbs($(this.$w.find('.breadcrumb-area')),cur_frm.meta.module,cur_frm.meta.name,cur_frm.docname);this.refresh_labels();this.refresh_toolbar();},refresh_labels:function(){var labinfo={0:['Saved','label-success'],1:['Submitted','label-info'],2:['Cancelled','label-important']}[cint(cur_frm.doc.docstatus)];if(labinfo[0]=='Saved'&&cur_frm.meta.is_submittable){labinfo[0]='Saved, to Submit';}
|
||||
if(cur_frm.doc.__unsaved){labinfo[0]='Not Saved';labinfo[1]='label-warning'}
|
||||
this.set_label(labinfo);},set_label:function(labinfo){this.$w.find('.label-area').html(repl('<span class="label %(lab_class)s">\
|
||||
%(lab_status)s</span>',{lab_status:labinfo[0],lab_class:labinfo[1]}));},refresh_toolbar:function(){this.appframe.clear_buttons();var p=cur_frm.get_doc_perms();if(cur_frm.meta.read_only_onload&&!cur_frm.doc.__islocal){if(!cur_frm.editable)
|
||||
this.appframe.add_button('Edit',function(){cur_frm.edit_doc();},'icon-pencil');else
|
||||
@ -1723,7 +1723,8 @@ _p.show_dialog();}
|
||||
_f.Frm.prototype.email_doc=function(){if(!_e.dialog)_e.make();sel=this.print_sel;var c=$td(_e.dialog.rows['Format'].tab,0,1);if(c.cur_sel){c.removeChild(c.cur_sel);c.cur_sel=null;}
|
||||
c.appendChild(this.print_sel);c.cur_sel=this.print_sel;_e.dialog.widgets['Send With Attachments'].checked=0;if(cur_frm.doc.file_list){$ds(_e.dialog.rows['Send With Attachments']);}else{$dh(_e.dialog.rows['Send With Attachments']);}
|
||||
_e.dialog.widgets['Subject'].value=get_doctype_label(this.meta.name)+': '+this.docname;_e.dialog.show();}
|
||||
_f.Frm.prototype.rename_notify=function(dt,old,name){if(this.docname==old)
|
||||
_f.Frm.prototype.rename_notify=function(dt,old,name){if(this.meta.in_dialog)
|
||||
return;if(this.docname==old)
|
||||
this.docname=name;else
|
||||
return;this.is_editable[name]=this.is_editable[old];delete this.is_editable[old];if(this&&this.opendocs[old]){local_dt[dt][name]=local_dt[dt][old];local_dt[dt][old]=null;}
|
||||
delete this.opendocs[old];this.opendocs[name]=true;wn.re_route[window.location.hash]='Form/'+encodeURIComponent(this.doctype)+'/'+encodeURIComponent(name);wn.set_route('Form',this.doctype,name);}
|
||||
@ -2212,7 +2213,7 @@ me.dialog.clear();me.dialog.show();}});
|
||||
wn.Application=Class.extend({init:function(){this.load_bootinfo();this.make_page_container();this.make_nav_bar();this.set_favicon();$(document).trigger('startup');wn.route();},load_bootinfo:function(){LocalDB.sync(wn.boot.docs);wn.control_panel=wn.boot.control_panel;if(wn.boot.error_messages)
|
||||
console.log(wn.boot.error_messages)
|
||||
if(wn.boot.server_messages)
|
||||
msgprint(wn.boot.server_messages);this.set_globals();},set_globals:function(){profile=wn.boot.profile;user=wn.boot.profile.name;user_fullname=wn.user_info(user).fullname;user_defaults=profile.defaults;user_roles=profile.roles;user_email=profile.email;sys_defaults=wn.boot.sysdefaults;},make_page_container:function(){wn.container=new wn.views.Container();wn.views.make_403();wn.views.make_404();},make_nav_bar:function(){if(wn.user.name!='Guest'){wn.container.wntoolbar=new wn.ui.toolbar.Toolbar();}},logout:function(){var me=this;wn.call({method:'logout',callback:function(r){if(r.exc){console.log(r.exc);return;}
|
||||
msgprint(wn.boot.server_messages);this.set_globals();},set_globals:function(){profile=wn.boot.profile;user=wn.boot.profile.name;user_fullname=wn.user_info(user).fullname;user_defaults=profile.defaults;user_roles=profile.roles;user_email=profile.email;sys_defaults=wn.boot.sysdefaults;},make_page_container:function(){wn.container=new wn.views.Container();wn.views.make_403();wn.views.make_404();},make_nav_bar:function(){if(wn.user.name!='Guest'){wn.container.wntoolbar=new wn.ui.toolbar.Toolbar();}},logout:function(){var me=this;me.logged_out=true;wn.call({method:'logout',callback:function(r){if(r.exc){console.log(r.exc);}
|
||||
me.redirect_to_login();}})},redirect_to_login:function(){window.location.hash='';window.location.reload();},set_favicon:function(){var link=$('link[type="image/x-icon"]').remove().attr("href");var favicon='\
|
||||
<link rel="shortcut icon" href="'+link+'" type="image/x-icon"> \
|
||||
<link rel="icon" href="'+link+'" type="image/x-icon">'
|
||||
|
@ -158,7 +158,7 @@ wn.get_route_str=function(route){if(!route)
|
||||
route=window.location.hash;if(route.substr(0,1)=='#')route=route.substr(1);if(route.substr(0,1)=='!')route=route.substr(1);return route;}
|
||||
wn.set_route=function(){route=$.map(arguments,function(a){return encodeURIComponent(a)}).join('/');window.location.hash=route;wn.app.set_favicon();}
|
||||
wn._cur_route=null;$(window).bind('hashchange',function(){if(location.hash==wn._cur_route)
|
||||
return;wn.route();if(wn.boot.analytics_code){try{eval(wn.boot.analytics_code);}catch(e){console.log(e);}}});
|
||||
return;wn.route();});
|
||||
/*
|
||||
* lib/js/wn/ui/listing.js
|
||||
*/
|
||||
@ -404,7 +404,8 @@ me.list.run();});this.dialog.show();},add_column:function(c){var w=$('<div style
|
||||
*/
|
||||
wn.provide('wn.request');wn.request.url='index.cgi';wn.request.prepare=function(opts){if(opts.btn)$(opts.btn).set_working();if(opts.show_spinner)set_loading();if(opts.freeze)freeze();if(!opts.args.cmd){console.log(opts)
|
||||
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. Logging you out');wn.app.logout();return;}
|
||||
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. Logging you out');if(!wn.app.logged_out)
|
||||
wn.app.logout();return;}
|
||||
if(r.server_messages)msgprint(r.server_messages)
|
||||
if(r.exc){console.log(r.exc);};if(r['403']){wn.container.change_to('403');}
|
||||
if(r.docs)LocalDB.sync(r.docs);}
|
||||
@ -417,7 +418,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){alert(txt);}}}
|
||||
if(!console){var console={log:function(txt){}}}
|
||||
wn.versions.check();$(document).bind('ready',function(){wn.provide('wn.app');$.extend(wn.app,new wn.Application());});
|
||||
|
||||
/*
|
||||
@ -823,7 +824,7 @@ if(errfld.length)msgprint('<b>Mandatory fields required in '+
|
||||
wn.Application=Class.extend({init:function(){this.load_bootinfo();this.make_page_container();this.make_nav_bar();this.set_favicon();$(document).trigger('startup');wn.route();},load_bootinfo:function(){LocalDB.sync(wn.boot.docs);wn.control_panel=wn.boot.control_panel;if(wn.boot.error_messages)
|
||||
console.log(wn.boot.error_messages)
|
||||
if(wn.boot.server_messages)
|
||||
msgprint(wn.boot.server_messages);this.set_globals();},set_globals:function(){profile=wn.boot.profile;user=wn.boot.profile.name;user_fullname=wn.user_info(user).fullname;user_defaults=profile.defaults;user_roles=profile.roles;user_email=profile.email;sys_defaults=wn.boot.sysdefaults;},make_page_container:function(){wn.container=new wn.views.Container();wn.views.make_403();wn.views.make_404();},make_nav_bar:function(){if(wn.user.name!='Guest'){wn.container.wntoolbar=new wn.ui.toolbar.Toolbar();}},logout:function(){var me=this;wn.call({method:'logout',callback:function(r){if(r.exc){console.log(r.exc);return;}
|
||||
msgprint(wn.boot.server_messages);this.set_globals();},set_globals:function(){profile=wn.boot.profile;user=wn.boot.profile.name;user_fullname=wn.user_info(user).fullname;user_defaults=profile.defaults;user_roles=profile.roles;user_email=profile.email;sys_defaults=wn.boot.sysdefaults;},make_page_container:function(){wn.container=new wn.views.Container();wn.views.make_403();wn.views.make_404();},make_nav_bar:function(){if(wn.user.name!='Guest'){wn.container.wntoolbar=new wn.ui.toolbar.Toolbar();}},logout:function(){var me=this;me.logged_out=true;wn.call({method:'logout',callback:function(r){if(r.exc){console.log(r.exc);}
|
||||
me.redirect_to_login();}})},redirect_to_login:function(){window.location.hash='';window.location.reload();},set_favicon:function(){var link=$('link[type="image/x-icon"]').remove().attr("href");var favicon='\
|
||||
<link rel="shortcut icon" href="'+link+'" type="image/x-icon"> \
|
||||
<link rel="icon" href="'+link+'" type="image/x-icon">'
|
||||
@ -882,8 +883,7 @@ wn.provide('erpnext.navbar');erpnext.navbar.Navbar=Class.extend({init:function()
|
||||
</ul>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>');$('.brand').attr('href','#!'+(wn.boot.website_settings.home_page||'Login Page'))},make_items:function(){var items=wn.boot.website_menus;for(var i=0;i<items.length;i++){var item=items[i];if(!item.parent_label&&item.parentfield=='top_bar_items'){console.log(item)
|
||||
erpnext.header_link_settings(item);$('header .nav:first').append(repl('<li data-label="%(label)s">\
|
||||
</div>');$('.brand').attr('href','#!'+(wn.boot.website_settings.home_page||'Login Page'))},make_items:function(){var items=wn.boot.website_menus;for(var i=0;i<items.length;i++){var item=items[i];if(!item.parent_label&&item.parentfield=='top_bar_items'){erpnext.header_link_settings(item);$('header .nav:first').append(repl('<li data-label="%(label)s">\
|
||||
<a href="%(route)s" %(target)s>%(label)s</a></li>',item));}}
|
||||
for(var i=0;i<items.length;i++){var item=items[i];if(item.parent_label&&item.parentfield=='top_bar_items'){$parent_li=$(repl('header li[data-label="%(parent_label)s"]',item));if(!$parent_li.hasClass('dropdown')){$parent_li.addClass('dropdown');$parent_li.find('a:first').addClass('dropdown-toggle').attr('data-toggle','dropdown').attr('href','').append('<b class="caret"></b>').click(function(){return false;});$parent_li.append('<ul class="dropdown-menu"></ul>');}
|
||||
erpnext.header_link_settings(item);$parent_li.find('.dropdown-menu').append(repl('<li data-label="%(label)s">\
|
||||
@ -896,5 +896,5 @@ $('footer').html(repl('<div class="web-footer">\
|
||||
<a href="https://erpnext.com">erpnext.com</a></div>\
|
||||
</div>',wn.boot.website_settings));this.make_items();},make_items:function(){var items=wn.boot.website_menus
|
||||
for(var i=0;i<items.length;i++){var item=items[i];if(!item.parent_label&&item.parentfield=='footer_items'){erpnext.header_link_settings(item);$('.web-footer-menu ul').append(repl('<li><a href="%(route)s" %(target)s\
|
||||
data-label="%(label)s">%(label)s</a></li>',item))}}}});erpnext.header_link_settings=function(item){item.route=item.url||item.custom_page;if(item.route.substr(0,4)=='http'){item.target='target="_blank"';}else{item.target='';item.route='#!'+item.route;}}
|
||||
data-label="%(label)s">%(label)s</a></li>',item))}}}});erpnext.header_link_settings=function(item){item.route=item.url||item.custom_page;if(item.route&&item.route.substr(0,4)=='http'){item.target='target="_blank"';}else{item.target='';item.route='#!'+item.route;}}
|
||||
$(document).bind('startup',function(){erpnext.footer=new erpnext.Footer();erpnext.navbar.navbar=new erpnext.navbar.Navbar();})
|
Loading…
Reference in New Issue
Block a user