fix in tag viewing in doclistview
This commit is contained in:
parent
3d72145f04
commit
9327bb9585
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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'}}
|
||||
]
|
||||
|
@ -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'}}
|
||||
]
|
||||
})
|
||||
|
@ -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'}}
|
||||
]
|
||||
})
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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'}}
|
||||
]
|
||||
});
|
@ -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'}}
|
||||
]
|
||||
|
@ -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'}}
|
||||
]
|
||||
});
|
||||
|
@ -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'}}
|
||||
]
|
||||
|
@ -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'}}
|
||||
|
@ -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'}}
|
||||
]
|
||||
});
|
@ -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'}}
|
||||
]
|
||||
|
@ -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'}}
|
||||
]
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user