diff --git a/erpnext/selling/doctype/lead/listview.js b/erpnext/selling/doctype/lead/listview.js new file mode 100644 index 0000000000..b5ed6b8c80 --- /dev/null +++ b/erpnext/selling/doctype/lead/listview.js @@ -0,0 +1,32 @@ +wn.doclistviews['Lead'] = wn.views.ListView.extend({ + init: function(d) { + this._super(d) + this.fields = this.fields.concat([ + 'tabLead.lead_name', + 'tabLead.status', + 'tabLead.source', + 'tabLead.rating' + ]); + this.stats = this.stats.concat(['status', 'source', 'rating']); + }, + + prepare_data: function(data) { + this._super(data); + if(data.status=='Interested') { + data.label_type = 'success' + } + else if(['Open', 'Attempted to Contact', 'Contacted', 'Contact in Future'].indexOf(data.status)!=-1) { + data.label_type = 'info' + } + data.status_html = repl('%(status)s', data); + + data.lead_name = (data.rating ? ('['+data.rating+'] ') : '') + '['+data.source+'] ' + data.lead_name; + }, + + columns: [ + {width: '20%', content:'name'}, + {width: '12%', content:'status_html'}, + {width: '55%', content:'tags+lead_name', css: {color:'#aaa'}}, + {width: '13%', 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 3c5258a40a..87c122491d 100644 --- a/erpnext/support/doctype/support_ticket/listview.js +++ b/erpnext/support/doctype/support_ticket/listview.js @@ -31,16 +31,15 @@ wn.doclistviews['Support Ticket'] = wn.views.ListView.extend({ // description if(data.description && data.description.length > 50) { - data.description = '' + data.description.substr(0,30) + '...'; + data.description = '' + data.description.substr(0,50) + '...'; } }, columns: [ - {width: '3%', content:'docstatus'}, - {width: '15%', content:'name'}, - {width: '8%', content:'status_html'}, - {width: '60%', content:'tags+description', css: {color:'#aaa'}}, - {width: '10%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} + {width: '20%', content:'name'}, + {width: '10%', content:'status_html'}, + {width: '56%', content:'tags+description', css: {color:'#aaa'}}, + {width: '14%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} ] }); diff --git a/js/all-app.js b/js/all-app.js index 5aaca817c1..88a2dd898d 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -1658,7 +1658,7 @@ var doc=locals[f.doctype][f.docname];var sl=this.get_status_tags(doc,f);this.set */ wn.provide('_f');_f.frms={};_f.Frm=function(doctype,parent){this.docname='';this.doctype=doctype;this.display=0;var me=this;this.is_editable={};this.opendocs={};this.sections=[];this.grids=[];this.cscript={};this.pformat={};this.fetch_dict={};this.parent=parent;this.tinymce_id_list=[];this.setup_meta(doctype);var me=this;$(document).bind('rename',function(event,dt,old_name,new_name){if(dt==me.doctype) me.rename_notify(dt,old_name,new_name)});} -_f.Frm.prototype.check_doctype_conflict=function(docname){var me=this;if(this.doctype=='DocType'){if(wn.views.formview[docname]){msgprint("Cannot open DocType when its instance is open") +_f.Frm.prototype.check_doctype_conflict=function(docname){var me=this;if(this.doctype=='DocType'&&docname=='DocType'){msgprint('Allowing DocType, DocType. Be careful!')}else if(this.doctype=='DocType'){if(wn.views.formview[docname]){msgprint("Cannot open DocType when its instance is open") throw'doctype open conflict'}}else{if(wn.views.formview.DocType&&wn.views.formview.DocType.frm.opendocs[this.doctype]){msgprint("Cannot open instance when its DocType is open") throw'doctype open conflict'}}} _f.Frm.prototype.setup=function(){var me=this;this.fields=[];this.fields_dict={};this.wrapper=this.parent;this.setup_print_layout();this.saved_wrapper=$a(this.wrapper,'div');this.setup_std_layout();this.setup_client_script();this.setup_done=true;} @@ -1857,7 +1857,8 @@ _f.Grid.prototype.hide=function(){$dh(this.wrapper);$dh(this.tbar_div);} _f.Grid.prototype.insert_column=function(doctype,fieldname,fieldtype,label,width,options,perm,reqd){var idx=this.head_row.cells.length;if(!width)width='100px';if((width+'').slice(-2)!='px'){width=width+'px';} var col=this.head_row.insertCell(idx);col.doctype=doctype;col.fieldname=fieldname;col.fieldtype=fieldtype;col.innerHTML='
'+label+'
';col.label=label;if(reqd) col.childNodes[0].style.color="#D22";col.style.width=width;col.options=options;col.perm=perm;this.col_idx_by_name[fieldname]=idx;} -_f.Grid.prototype.reset_table_width=function(){var w=0;for(var i=0,len=this.head_row.cells.length;i