employee list -- show status
This commit is contained in:
parent
2c2a17f138
commit
cbf181c390
@ -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('<span class="label label-%(label_type)s" \
|
||||
support_list_status="%(status)s">%(status)s</span>', 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'}},
|
||||
|
@ -29,10 +29,7 @@ wn.doclistviews['Support Ticket'] = wn.views.ListView.extend({
|
||||
data.status = 'Waiting'
|
||||
}
|
||||
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
|
||||
data.description = cstr(data.subject).replace(/"/gi, '\"')
|
||||
+ " | " + cstr(data.description).replace(/"/gi, '\"');
|
||||
|
Loading…
x
Reference in New Issue
Block a user