setting list_views

This commit is contained in:
Rushabh Mehta
2013-01-29 17:53:29 +05:30
parent 6abb2e67e9
commit 08da1a0a3d
105 changed files with 575 additions and 1736 deletions

View File

@@ -1,8 +1,8 @@
[
{
"creation": "2013-01-10 16:34:13",
"creation": "2013-01-23 19:57:17",
"docstatus": 0,
"modified": "2013-01-22 14:56:01",
"modified": "2013-01-29 17:47:25",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -56,6 +56,7 @@
"doctype": "DocField",
"fieldname": "image_view",
"fieldtype": "Image",
"in_list_view": 1,
"label": "Image View",
"options": "image"
},
@@ -95,6 +96,7 @@
"doctype": "DocField",
"fieldname": "employee_name",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Full Name",
"oldfieldname": "employee_name",
"oldfieldtype": "Data",
@@ -191,6 +193,7 @@
"fieldname": "status",
"fieldtype": "Select",
"in_filter": 1,
"in_list_view": 1,
"label": "Status",
"oldfieldname": "status",
"oldfieldtype": "Select",
@@ -203,6 +206,7 @@
"fieldname": "employment_type",
"fieldtype": "Link",
"in_filter": 1,
"in_list_view": 1,
"label": "Employment Type",
"oldfieldname": "employment_type",
"oldfieldtype": "Link",

View File

@@ -1,56 +0,0 @@
// render
wn.doclistviews['Employee'] = wn.views.ListView.extend({
init: function(d) {
this._super(d)
this.fields = this.fields.concat([
"`tabEmployee`.employee_name",
"`tabEmployee`.employee_number",
"`tabEmployee`.employment_type",
"`tabEmployee`.designation",
"`tabEmployee`.department",
"`tabEmployee`.branch",
"`tabEmployee`.company",
"`tabEmployee`.reports_to",
"`tabEmployee`.date_of_joining",
"`tabEmployee`.status",
]);
this.stats = this.stats.concat(['status', 'company']);
},
prepare_data: function(data) {
this._super(data);
data.employee_name = data.employee_name
+ (data.employee_number ? ' [' + data.employee_number + ']' : '');
data.date_of_joining = wn.datetime.str_to_user(data.date_of_joining);
data.designation = data.designation
+ (data.employment_type ? ' [' + data.employment_type + ']' : '');
var concat_list = [];
data.designation && concat_list.push(data.designation);
data.department && concat_list.push(data.department);
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: '12%', content: 'name'},
{width: '25%', content: 'employee_name'},
{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'}},
]
});