mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-18 20:49:19 +00:00
employee list -- show status
This commit is contained in:
@@ -12,8 +12,9 @@ wn.doclistviews['Employee'] = wn.views.ListView.extend({
|
|||||||
"`tabEmployee`.company",
|
"`tabEmployee`.company",
|
||||||
"`tabEmployee`.reports_to",
|
"`tabEmployee`.reports_to",
|
||||||
"`tabEmployee`.date_of_joining",
|
"`tabEmployee`.date_of_joining",
|
||||||
|
"`tabEmployee`.status",
|
||||||
]);
|
]);
|
||||||
this.stats = this.stats.concat(['company']);
|
this.stats = this.stats.concat(['status', 'company']);
|
||||||
},
|
},
|
||||||
|
|
||||||
prepare_data: function(data) {
|
prepare_data: function(data) {
|
||||||
@@ -32,14 +33,22 @@ wn.doclistviews['Employee'] = wn.views.ListView.extend({
|
|||||||
data.company && concat_list.push(data.company);
|
data.company && concat_list.push(data.company);
|
||||||
data.branch && concat_list.push(data.branch);
|
data.branch && concat_list.push(data.branch);
|
||||||
data.description = concat_list.join(", ");
|
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('<span class="label label-%(label_type)s" \
|
||||||
|
support_list_status="%(status)s">%(status)s</span>', data);
|
||||||
},
|
},
|
||||||
|
|
||||||
columns: [
|
columns: [
|
||||||
{width: '3%', content: 'check'},
|
{width: '3%', content: 'check'},
|
||||||
{width: '3%', content: 'docstatus'},
|
|
||||||
{width: '12%', content: 'name'},
|
{width: '12%', content: 'name'},
|
||||||
{width: '25%', content: 'employee_name'},
|
{width: '25%', content: 'employee_name'},
|
||||||
{width: '45%', content: 'description+tags',
|
{width: '10%', content: 'status_html'},
|
||||||
|
{width: '38%', content: 'description+tags',
|
||||||
css: {'color': '#aaa'}},
|
css: {'color': '#aaa'}},
|
||||||
{width: '12%', content:'date_of_joining',
|
{width: '12%', content:'date_of_joining',
|
||||||
css: {'text-align': 'right', 'color': '#777'}},
|
css: {'text-align': 'right', 'color': '#777'}},
|
||||||
|
|||||||
@@ -29,10 +29,7 @@ wn.doclistviews['Support Ticket'] = wn.views.ListView.extend({
|
|||||||
data.status = 'Waiting'
|
data.status = 'Waiting'
|
||||||
}
|
}
|
||||||
data.status_html = repl('<span class="label label-%(label_type)s">%(status)s</span>', data);
|
data.status_html = repl('<span class="label label-%(label_type)s">%(status)s</span>', data);
|
||||||
var a = $(data.status_html).click(function() {
|
|
||||||
me.set_filter('status', $(this).text());
|
|
||||||
});
|
|
||||||
|
|
||||||
// escape double quotes
|
// escape double quotes
|
||||||
data.description = cstr(data.subject).replace(/"/gi, '\"')
|
data.description = cstr(data.subject).replace(/"/gi, '\"')
|
||||||
+ " | " + cstr(data.description).replace(/"/gi, '\"');
|
+ " | " + cstr(data.description).replace(/"/gi, '\"');
|
||||||
|
|||||||
Reference in New Issue
Block a user