From 64483e6e18b5dcdb41e4d1eea0d2f495e45e0179 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 23 May 2012 13:41:11 +0530 Subject: [PATCH 1/2] fix in report builder's print function --- public/js/report-legacy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/report-legacy.js b/public/js/report-legacy.js index c33ce6ca84..6f7fae671d 100644 --- a/public/js/report-legacy.js +++ b/public/js/report-legacy.js @@ -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 Date: Wed, 23 May 2012 15:12:22 +0530 Subject: [PATCH 2/2] fix in tag viewing in doclistview --- erpnext/accounts/doctype/journal_voucher/listview.js | 2 +- erpnext/accounts/doctype/purchase_invoice/listview.js | 2 +- erpnext/accounts/doctype/sales_invoice/listview.js | 2 +- erpnext/buying/doctype/purchase_order/listview.js | 2 +- erpnext/buying/doctype/purchase_request/listview.js | 2 +- erpnext/selling/doctype/lead/listview.js | 2 +- erpnext/selling/doctype/opportunity/listview.js | 2 +- erpnext/selling/doctype/quotation/listview.js | 2 +- erpnext/selling/doctype/sales_order/listview.js | 2 +- erpnext/stock/doctype/batch/listview.js | 2 +- erpnext/stock/doctype/delivery_note/listview.js | 2 +- erpnext/stock/doctype/item/listview.js | 2 +- erpnext/stock/doctype/purchase_receipt/listview.js | 2 +- erpnext/stock/doctype/stock_entry/listview.js | 2 +- erpnext/stock/doctype/warehouse/listview.js | 2 +- erpnext/support/doctype/customer_issue/listview.js | 2 +- erpnext/support/doctype/support_ticket/listview.js | 2 +- public/js/all-app.js | 10 ++++++---- 18 files changed, 23 insertions(+), 21 deletions(-) diff --git a/erpnext/accounts/doctype/journal_voucher/listview.js b/erpnext/accounts/doctype/journal_voucher/listview.js index eb3bd35043..129f3cdc91 100644 --- a/erpnext/accounts/doctype/journal_voucher/listview.js +++ b/erpnext/accounts/doctype/journal_voucher/listview.js @@ -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) { diff --git a/erpnext/accounts/doctype/purchase_invoice/listview.js b/erpnext/accounts/doctype/purchase_invoice/listview.js index 2de50d3b4d..54913a5c2b 100644 --- a/erpnext/accounts/doctype/purchase_invoice/listview.js +++ b/erpnext/accounts/doctype/purchase_invoice/listview.js @@ -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) { diff --git a/erpnext/accounts/doctype/sales_invoice/listview.js b/erpnext/accounts/doctype/sales_invoice/listview.js index 626686b3bf..8171b913b2 100644 --- a/erpnext/accounts/doctype/sales_invoice/listview.js +++ b/erpnext/accounts/doctype/sales_invoice/listview.js @@ -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) { diff --git a/erpnext/buying/doctype/purchase_order/listview.js b/erpnext/buying/doctype/purchase_order/listview.js index 3cd3287e64..0f90e12193 100644 --- a/erpnext/buying/doctype/purchase_order/listview.js +++ b/erpnext/buying/doctype/purchase_order/listview.js @@ -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) { diff --git a/erpnext/buying/doctype/purchase_request/listview.js b/erpnext/buying/doctype/purchase_request/listview.js index 64ed8fa035..e4266c7606 100644 --- a/erpnext/buying/doctype/purchase_request/listview.js +++ b/erpnext/buying/doctype/purchase_request/listview.js @@ -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'}} ] diff --git a/erpnext/selling/doctype/lead/listview.js b/erpnext/selling/doctype/lead/listview.js index b4d89347fa..7088b3532c 100644 --- a/erpnext/selling/doctype/lead/listview.js +++ b/erpnext/selling/doctype/lead/listview.js @@ -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'}} ] }) diff --git a/erpnext/selling/doctype/opportunity/listview.js b/erpnext/selling/doctype/opportunity/listview.js index 74cfbd1ce1..a661d813f5 100644 --- a/erpnext/selling/doctype/opportunity/listview.js +++ b/erpnext/selling/doctype/opportunity/listview.js @@ -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'}} ] }) diff --git a/erpnext/selling/doctype/quotation/listview.js b/erpnext/selling/doctype/quotation/listview.js index cf3a807bd1..d1fad5aa82 100644 --- a/erpnext/selling/doctype/quotation/listview.js +++ b/erpnext/selling/doctype/quotation/listview.js @@ -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) { diff --git a/erpnext/selling/doctype/sales_order/listview.js b/erpnext/selling/doctype/sales_order/listview.js index 19d6a92032..cbe35daae1 100644 --- a/erpnext/selling/doctype/sales_order/listview.js +++ b/erpnext/selling/doctype/sales_order/listview.js @@ -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) { diff --git a/erpnext/stock/doctype/batch/listview.js b/erpnext/stock/doctype/batch/listview.js index d8e19b3a5b..52e415667e 100644 --- a/erpnext/stock/doctype/batch/listview.js +++ b/erpnext/stock/doctype/batch/listview.js @@ -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'}} ] }); \ No newline at end of file diff --git a/erpnext/stock/doctype/delivery_note/listview.js b/erpnext/stock/doctype/delivery_note/listview.js index 8c29961a1d..e65d75a0e7 100644 --- a/erpnext/stock/doctype/delivery_note/listview.js +++ b/erpnext/stock/doctype/delivery_note/listview.js @@ -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'}} ] diff --git a/erpnext/stock/doctype/item/listview.js b/erpnext/stock/doctype/item/listview.js index 345aa57fca..02ed1616d3 100644 --- a/erpnext/stock/doctype/item/listview.js +++ b/erpnext/stock/doctype/item/listview.js @@ -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'}} ] }); diff --git a/erpnext/stock/doctype/purchase_receipt/listview.js b/erpnext/stock/doctype/purchase_receipt/listview.js index 5062091f8b..870485953e 100644 --- a/erpnext/stock/doctype/purchase_receipt/listview.js +++ b/erpnext/stock/doctype/purchase_receipt/listview.js @@ -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'}} ] diff --git a/erpnext/stock/doctype/stock_entry/listview.js b/erpnext/stock/doctype/stock_entry/listview.js index 91a3ae8715..90f43a79da 100644 --- a/erpnext/stock/doctype/stock_entry/listview.js +++ b/erpnext/stock/doctype/stock_entry/listview.js @@ -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'}} diff --git a/erpnext/stock/doctype/warehouse/listview.js b/erpnext/stock/doctype/warehouse/listview.js index 00b1e2e3a7..0abb7f94f0 100644 --- a/erpnext/stock/doctype/warehouse/listview.js +++ b/erpnext/stock/doctype/warehouse/listview.js @@ -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'}} ] }); \ No newline at end of file diff --git a/erpnext/support/doctype/customer_issue/listview.js b/erpnext/support/doctype/customer_issue/listview.js index 43e6125d95..5b5c88db28 100644 --- a/erpnext/support/doctype/customer_issue/listview.js +++ b/erpnext/support/doctype/customer_issue/listview.js @@ -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'}} ] diff --git a/erpnext/support/doctype/support_ticket/listview.js b/erpnext/support/doctype/support_ticket/listview.js index 58b3866898..cc9828e4d0 100644 --- a/erpnext/support/doctype/support_ticket/listview.js +++ b/erpnext/support/doctype/support_ticket/listview.js @@ -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'}} ] diff --git a/public/js/all-app.js b/public/js/all-app.js index 54ba5ddd0d..3d2b40a53f 100644 --- a/public/js/all-app.js +++ b/public/js/all-app.js @@ -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=$('').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(' '+this.label);}else{this.$a.append(' '+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(' '+this.label);}else{this.$a.append(' '+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=$('
    ').toggle(false).appendTo(this.parent);} -return new wn.ui.TreeNode({tree:this.tree,parent:$('
  • ').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=$('
      ').toggle(false).appendTo(this.parent);} +return new wn.ui.TreeNode({tree:this.tree,parent:$('
    • ').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){$('' +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('
      ');} +$.each(data._user_tags.split(','),function(i,t){if(t){$('' +strip(t)+'').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