Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Nabin Hait 2012-05-23 16:22:41 +05:30
commit 4aaaa8af7b
19 changed files with 24 additions and 22 deletions

View File

@ -23,7 +23,7 @@ wn.doclistviews['Journal Voucher'] = wn.views.ListView.extend({
{width: '3%', content: 'docstatus'},
{width: '12%', content: 'name'},
{width: '15%', content: 'voucher_type'},
{width: '32%', content: 'tags+remark', css: {'color':'#222'}},
{width: '32%', content: 'remark+tags', css: {'color':'#222'}},
{
width: '18%',
content: function(parent, data) {

View File

@ -24,7 +24,7 @@ wn.doclistviews['Purchase Invoice'] = wn.views.ListView.extend({
{width: '5%', content: 'avatar'},
{width: '3%', content: 'docstatus'},
{width: '15%', content: 'name'},
{width: '34%', content: 'tags+supplier_name', css: {color: '#222'}},
{width: '34%', content: 'supplier_name+tags', css: {color: '#222'}},
{
width: '18%',
content: function(parent, data) {

View File

@ -19,7 +19,7 @@ wn.doclistviews['Sales Invoice'] = wn.views.ListView.extend({
{width: '5%', content: 'avatar'},
{width: '3%', content: 'docstatus'},
{width: '15%', content: 'name'},
{width: '34%', content: 'tags+customer_name', css: {color:'#222'}},
{width: '34%', content: 'customer_name+tags', css: {color:'#222'}},
{
width: '18%',
content: function(parent, data) {

View File

@ -17,7 +17,7 @@ wn.doclistviews['Purchase Order'] = wn.views.ListView.extend({
{width: '5%', content: 'avatar'},
{width: '3%', content: 'docstatus'},
{width: '15%', content: 'name'},
{width: '28%', content: 'tags+supplier_name', css: {color:'#222'}},
{width: '28%', content: 'supplier_name+tags', css: {color:'#222'}},
{
width: '18%',
content: function(parent, data) {

View File

@ -26,7 +26,7 @@ wn.doclistviews['Purchase Request'] = wn.views.ListView.extend({
{width: '5%', content:'avatar'},
{width: '3%', content:'docstatus'},
{width: '17%', content:'name'},
{width: '50%', content:'status_html+tags+remark', css: {'color': '#222'}},
{width: '50%', content:'status_html+remark+tags', css: {'color': '#222'}},
{width: '10%', content: 'per_ordered', type:'bar-graph', label:'Ordered'},
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
]

View File

@ -27,7 +27,7 @@ wn.doclistviews['Lead'] = wn.views.ListView.extend({
{width: '3%', content: 'check'},
{width: '20%', content:'name'},
{width: '12%', content:'status_html'},
{width: '52%', content:'tags+lead_name', css: {color:'#222'}},
{width: '52%', content:'lead_name+tags', css: {color:'#222'}},
{width: '13%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
]
})

View File

@ -32,7 +32,7 @@ wn.doclistviews['Opportunity'] = wn.views.ListView.extend({
{width: '3%', content: 'check'},
{width: '15%', content:'name'},
{width: '18%', content:'status_html'},
{width: '52%', content:'tags+enquiry_name', css: {color:'#222'}},
{width: '52%', content:'enquiry_name+tags', css: {color:'#222'}},
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
]
})

View File

@ -26,7 +26,7 @@ wn.doclistviews['Quotation'] = wn.views.ListView.extend({
{width: '5%', content:'avatar'},
{width: '3%', content:'docstatus'},
{width: '15%', content:'name'},
{width: '44%', content:'tags+quotation_name', css: {color:'#222'}},
{width: '44%', content:'quotation_name+tags', css: {color:'#222'}},
{
width: '18%',
content: function(parent, data) {

View File

@ -17,7 +17,7 @@ wn.doclistviews['Sales Order'] = wn.views.ListView.extend({
{width: '5%', content:'avatar'},
{width: '3%', content:'docstatus'},
{width: '15%', content:'name'},
{width: '32%', content:'tags+customer_name', css: {color:'#222'}},
{width: '32%', content:'customer_name+tags', css: {color:'#222'}},
{
width: '18%',
content: function(parent, data) {

View File

@ -22,7 +22,7 @@ wn.doclistviews['Batch'] = wn.views.ListView.extend({
{width: '5%', content:'avatar'},
{width: '15%', content:'name'},
{width: '15%', content:'item'},
{width: '50%', content:'tags+description'},
{width: '50%', content:'description+tags'},
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
]
});

View File

@ -12,7 +12,7 @@ wn.doclistviews['Delivery Note'] = wn.views.ListView.extend({
{width: '5%', content:'avatar'},
{width: '3%', content:'docstatus'},
{width: '15%', content:'name'},
{width: '47%', content:'tags+customer_name', css: {color:'#222'}},
{width: '47%', content:'customer_name+tags', css: {color:'#222'}},
{width: '15%', content:'sales_order_no', type:'link', doctype:'Sales Order'},
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
]

View File

@ -22,7 +22,7 @@ wn.doclistviews['Item'] = wn.views.ListView.extend({
{width: '3%', content: 'check'},
{width: '5%', content:'avatar'},
{width: '20%', content:'name'},
{width: '60%', content:'tags+description', css: {'color': '#222'}},
{width: '60%', content:'description+tags', css: {'color': '#222'}},
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
]
});

View File

@ -12,7 +12,7 @@ wn.doclistviews['Purchase Receipt'] = wn.views.ListView.extend({
{width: '5%', content:'avatar'},
{width: '3%', content:'docstatus'},
{width: '15%', content:'name'},
{width: '47%', content:'tags+supplier_name', css: {color:'#222'}},
{width: '47%', content:'supplier_name+tags', css: {color:'#222'}},
{width: '15%', content:'purchase_order_no', type:'link', doctype:'Purchase Order Order'},
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
]

View File

@ -13,7 +13,7 @@ wn.doclistviews['Stock Entry'] = wn.views.ListView.extend({
{width: '5%', content:'avatar'},
{width: '3%', content:'docstatus'},
{width: '15%', content:'name'},
{width: '15%', content:'tags+purpose', css: {color:'#222'}},
{width: '15%', content:'purpose+tags', css: {color:'#222'}},
{width: '18%', content:'from_warehouse', template: 'From %(from_warehouse)s'},
{width: '18%', content:'to_warehouse', template: 'To %(to_warehouse)s'},
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}

View File

@ -29,7 +29,7 @@ wn.doclistviews['Warehouse'] = wn.views.ListView.extend({
{width: '5%', content:'avatar'},
{width: '20%', content:'name'},
{width: '15%', content:'warehouse_type'},
{width: '45%', content:'tags+address'},
{width: '45%', content:'address+tags'},
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
]
});

View File

@ -52,7 +52,7 @@ wn.doclistviews['Customer Issue'] = wn.views.ListView.extend({
{width: '3%', content: 'docstatus'},
{width: '20%', content: 'name'},
{width: '10%', content: 'status_html'},
{width: '47%', content: 'tags+complaint', css: {color:'#777'}},
{width: '47%', content: 'complaint+tags', css: {color:'#777'}},
{width: '12%', content: 'modified',
css: {'text-align': 'right', 'color':'#777'}}
]

View File

@ -47,7 +47,7 @@ wn.doclistviews['Support Ticket'] = wn.views.ListView.extend({
{width: '3%', content: 'check'},
{width: '20%', content:'name'},
{width: '10%', content:'status_html'},
{width: '50%', content:'tags+description', css: {color:'#222'}},
{width: '50%', content:'description+tags', css: {color:'#222'}},
{width: '14%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
]

View File

@ -918,11 +918,12 @@ wn.ui.Tree=Class.extend({init:function(args){$.extend(this,args);this.nodes={};t
.tree-link { cursor: pointer; }\
")}})
wn.ui.TreeNode=Class.extend({init:function(args){var me=this;$.extend(this,args);this.loaded=false;this.expanded=false;this.tree.nodes[this.label]=this;this.$a=$('<a class="tree-link">').click(function(){if(me.expandable&&me.tree.method&&!me.loaded){me.load()}else{me.selectnode();}
if(me.tree.click)me.tree.click(this);}).bind('reload',function(){me.reload();}).data('label',this.label).appendTo(this.parent);if(this.expandable){this.$a.append('<i class="icon-folder-close"></i> '+this.label);}else{this.$a.append('<i class="icon-file"></i> '+this.label);}},selectnode:function(){if(this.$ul){this.$ul.toggle();this.$a.find('i').removeClass();if(this.$ul.css('display').toLowerCase()=='block'){this.$a.find('i').addClass('icon-folder-open');}else{this.$a.find('i').addClass('icon-folder-close');}}
if(me.tree.click)me.tree.click(this);}).bind('reload',function(){me.reload();}).data('label',this.label).appendTo(this.parent);if(this.expandable){this.$a.append('<i class="icon-folder-close"></i> '+this.label);}else{this.$a.append('<i class="icon-file"></i> '+this.label);}
if(this.tree.onrender){this.tree.onrender(this);}},selectnode:function(){if(this.$ul){this.$ul.toggle();this.$a.find('i').removeClass();if(this.$ul.css('display').toLowerCase()=='block'){this.$a.find('i').addClass('icon-folder-open');}else{this.$a.find('i').addClass('icon-folder-close');}}
this.tree.$w.find('a.selected').removeClass('selected');this.$a.toggleClass('selected');this.expanded=!this.expanded;},reload:function(){if(this.expanded){this.$a.click();}
if(this.$ul){this.$ul.empty();}
this.load();},addnode:function(label,expandable){if(!this.$ul){this.$ul=$('<ul>').toggle(false).appendTo(this.parent);}
return new wn.ui.TreeNode({tree:this.tree,parent:$('<li>').appendTo(this.$ul),label:label,expandable:expandable});},load:function(){var me=this;args=$.extend(this.tree.args,{parent:this.label});$(me.$a).set_working();wn.call({method:this.tree.method,args:args,callback:function(r){$(me.$a).done_working();$.each(r.message,function(i,v){node=me.addnode(v.value||v,v.expandable);node.$a.data('node-data',v);});me.loaded=true;me.selectnode();}})}})
this.load();},addnode:function(data){if(!this.$ul){this.$ul=$('<ul>').toggle(false).appendTo(this.parent);}
return new wn.ui.TreeNode({tree:this.tree,parent:$('<li>').appendTo(this.$ul),label:data.value,expandable:data.expandable,data:data});},load:function(){var me=this;args=$.extend(this.tree.args,{parent:this.label});$(me.$a).set_working();wn.call({method:this.tree.method,args:args,callback:function(r){$(me.$a).done_working();$.each(r.message,function(i,v){node=me.addnode(v);node.$a.data('node-data',v);});me.loaded=true;me.selectnode();}})}})
/*
* lib/js/wn/upload.js
*/
@ -1019,7 +1020,8 @@ else if(data[opts.content]){$(parent).append(' '+data[opts.content]);}},render:f
if(diff==1){data.when='Yesterday'}
if(diff==2){data.when='2 days ago'}
if(data.docstatus==0||data.docstatus==null){data.docstatus_icon='icon-pencil';data.docstatus_title='Editable';}else if(data.docstatus==1){data.docstatus_icon='icon-lock';data.docstatus_title='Submitted';}else if(data.docstatus==2){data.docstatus_icon='icon-remove';data.docstatus_title='Cancelled';}
for(key in data){if(data[key]==null){data[key]='';}}},add_user_tags:function(parent,data){var me=this;if(data._user_tags){$.each(data._user_tags.split(','),function(i,t){if(t){$('<span class="label label-info" style="cursor: pointer">'
for(key in data){if(data[key]==null){data[key]='';}}},add_user_tags:function(parent,data){var me=this;if(data._user_tags){if($(parent).html().length>0){$(parent).append('<br />');}
$.each(data._user_tags.split(','),function(i,t){if(t){$('<span class="label label-info" style="cursor: pointer; line-height: 200%">'
+strip(t)+'</span>').click(function(){me.doclistview.set_filter('_user_tags',$(this).text())}).appendTo(parent);}});}},show_hide_check_column:function(){if(!this.doclistview.can_delete){this.columns=$.map(this.columns,function(v,i){if(v.content!='check')return v});}}})
/*
* lib/js/wn/views/formview.js

View File

@ -208,7 +208,7 @@ c.style.color=row.style.color;if(row.style.backgroundColor)
c.style.backgroundColor=row.style.backgroundColor;if(row.style.fontWeight)
c.style.fontWeight=row.style.fontWeight;if(row.style.fontSize)
c.style.fontSize=row.style.fontSize;var w=this.get_col_width(ci);if(w)$w(c,w);c.val=val;var me=this;c.div=$a(c,'div','',{width:(cint(w)-7)+'px'});$s(c.div,val,this.coltypes[ci],this.coloptions[ci])}
_r.DataTable.prototype.do_print=function(){this._get_query(true);args={query:this.query,title:this.rep_name?this.rep_name:this.dt,colnames:null,colwidhts:null,coltypes:null,has_index:this.has_index,has_headings:this.has_headings,check_limit:1,is_simple:(this.is_simple?'Yes':''),sc_id:(this.search_criteria?this.search_criteria.name:''),filter_values:docstring(this.filter_vals),finder:this.finder?this.finder:null};wn.require('js/print_query.js');_p.print_query=new _p.PrintQuery();_p.print_query.show_dialog(args);}
_r.DataTable.prototype.do_print=function(){this._get_query(true);args={query:this.query,title:this.rep_name?this.rep_name:this.dt,colnames:null,colwidhts:null,coltypes:null,has_index:this.has_index,has_headings:this.has_headings,check_limit:1,is_simple:(this.is_simple?'Yes':''),sc_id:(this.search_criteria?this.search_criteria.name:''),filter_values:docstring(this.filter_vals),};wn.require('js/print_query.js');_p.print_query=new _p.PrintQuery();_p.print_query.show_dialog(args);}
_r.DataTable.prototype.do_export=function(){this._get_query(true);var me=this;export_query(this.query,function(q){export_csv(q,(me.rep_name?me.rep_name:me.dt),(me.search_criteria?me.search_criteria.name:''),me.is_simple,docstring(me.filter_vals));});}
_r.DataTable.prototype.do_calc=function(){_r.show_calc(this.tab,this.colnames,this.coltypes,1);}
_r.DataTable.prototype.get_col_data=function(colname){var ci=0;if(!this.htab)return[];for(var i=1;i<this.htab.rows[0].cells.length;i++){var hc=this.htab.rows[0].cells[i];if(hc.val==colname){ci=i;break;}}