From cbf181c390fbc2c70506ad11c39b28cfbc5f7c8b Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 28 Jun 2012 18:38:38 +0530 Subject: [PATCH] employee list -- show status --- erpnext/hr/doctype/employee/listview.js | 15 ++++++++++++--- .../support/doctype/support_ticket/listview.js | 5 +---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/erpnext/hr/doctype/employee/listview.js b/erpnext/hr/doctype/employee/listview.js index 4f92bbff29..fbd338e99a 100644 --- a/erpnext/hr/doctype/employee/listview.js +++ b/erpnext/hr/doctype/employee/listview.js @@ -12,8 +12,9 @@ wn.doclistviews['Employee'] = wn.views.ListView.extend({ "`tabEmployee`.company", "`tabEmployee`.reports_to", "`tabEmployee`.date_of_joining", + "`tabEmployee`.status", ]); - this.stats = this.stats.concat(['company']); + this.stats = this.stats.concat(['status', 'company']); }, prepare_data: function(data) { @@ -32,14 +33,22 @@ wn.doclistviews['Employee'] = wn.views.ListView.extend({ data.company && concat_list.push(data.company); data.branch && concat_list.push(data.branch); data.description = concat_list.join(", "); + + if(data.status=='Left') { + data.label_type = 'important'; + } else if(data.status=='Active') { + data.label_type = 'success'; + } + data.status_html = repl('%(status)s', data); }, columns: [ {width: '3%', content: 'check'}, - {width: '3%', content: 'docstatus'}, {width: '12%', content: 'name'}, {width: '25%', content: 'employee_name'}, - {width: '45%', content: 'description+tags', + {width: '10%', content: 'status_html'}, + {width: '38%', content: 'description+tags', css: {'color': '#aaa'}}, {width: '12%', content:'date_of_joining', 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 eb0ba72551..503e2ab8ba 100644 --- a/erpnext/support/doctype/support_ticket/listview.js +++ b/erpnext/support/doctype/support_ticket/listview.js @@ -29,10 +29,7 @@ wn.doclistviews['Support Ticket'] = wn.views.ListView.extend({ data.status = 'Waiting' } data.status_html = repl('%(status)s', data); - var a = $(data.status_html).click(function() { - me.set_filter('status', $(this).text()); - }); - + // escape double quotes data.description = cstr(data.subject).replace(/"/gi, '\"') + " | " + cstr(data.description).replace(/"/gi, '\"');