From e229315d88186b98879970dda9ba16b6cfb1b1f7 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 18 Feb 2013 14:22:06 +0530 Subject: [PATCH 01/13] fixes in file manager --- webnotes/utils/file_manager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webnotes/utils/file_manager.py b/webnotes/utils/file_manager.py index 70af7a7b81..d92f810bff 100644 --- a/webnotes/utils/file_manager.py +++ b/webnotes/utils/file_manager.py @@ -23,6 +23,7 @@ from __future__ import unicode_literals import webnotes import os, conf +from webnotes.utils import cstr def upload(): # get record details @@ -94,7 +95,7 @@ def get_uploaded_content(): # should not be unicode when reading a file, hence using webnotes.form if 'filedata' in webnotes.form: i = webnotes.form['filedata'] - webnotes.uploaded_filename, webnotes.uploaded_content = i.filename, i.file.read() + webnotes.uploaded_filename, webnotes.uploaded_content = cstr(i.filename), i.file.read() return webnotes.uploaded_filename, webnotes.uploaded_content else: webnotes.msgprint('No File') From 5f89847fb8e0e8ae32f433b74a72a40a7db47570 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 18 Feb 2013 18:00:53 +0530 Subject: [PATCH 02/13] make a doctype importable and allow submission in data import tool --- core/doctype/doctype/doctype.txt | 11 +++++++++-- core/page/data_import_tool/data_import_tool.js | 12 ++++++++++-- core/page/data_import_tool/data_import_tool.py | 11 ++++++++++- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/core/doctype/doctype/doctype.txt b/core/doctype/doctype/doctype.txt index 37391b363e..c886ffb918 100644 --- a/core/doctype/doctype/doctype.txt +++ b/core/doctype/doctype/doctype.txt @@ -1,8 +1,8 @@ [ { - "creation": "2013-01-15 17:23:52", + "creation": "2013-02-18 13:36:19", "docstatus": 0, - "modified": "2013-01-22 14:56:00", + "modified": "2013-02-18 17:19:42", "modified_by": "Administrator", "owner": "Administrator" }, @@ -161,6 +161,13 @@ "reqd": 0, "search_index": 0 }, + { + "description": "Allow Import via Data Import Tool", + "doctype": "DocField", + "fieldname": "allow_import", + "fieldtype": "Check", + "label": "Allow Import" + }, { "doctype": "DocField", "fieldname": "cb11", diff --git a/core/page/data_import_tool/data_import_tool.js b/core/page/data_import_tool/data_import_tool.js index a8d4ecab27..580fbaaa1f 100644 --- a/core/page/data_import_tool/data_import_tool.js +++ b/core/page/data_import_tool/data_import_tool.js @@ -141,15 +141,23 @@ wn.pages['data-import-tool'].onload = function(wrapper) { }); // add overwrite option + var $submit_btn = $('#dit-upload-area form input[type="submit"]'); $('\ Overwrite\

If you are uploading a child table (for example Item Price), the all the entries of that table will be deleted (for that parent record) and new entries will be made.


') - .insertBefore('#dit-upload-area form input[type="submit"]') + .insertBefore($submit_btn); + + // add submit option + $('\ + Submit\ +

If you are inserting new records (overwrite not checked) \ + and if you have submit permission, the record will be submitted.


') + .insertBefore($submit_btn); // add ignore option $('\ Ignore Encoding Errors

') - .insertBefore('#dit-upload-area form input[type="submit"]') + .insertBefore($submit_btn); // rename button $('#dit-upload-area form input[type="submit"]') diff --git a/core/page/data_import_tool/data_import_tool.py b/core/page/data_import_tool/data_import_tool.py index 9ff43751a2..0a6a3d0e6a 100644 --- a/core/page/data_import_tool/data_import_tool.py +++ b/core/page/data_import_tool/data_import_tool.py @@ -19,7 +19,7 @@ doctype_dl = None @webnotes.whitelist() def get_doctypes(): return [r[0] for r in webnotes.conn.sql("""select name from `tabDocType` - where document_type = 'Master'""")] + where document_type = 'Master' or allow_import = 1""")] @webnotes.whitelist() def get_doctype_options(): @@ -137,6 +137,9 @@ def getdocfield(fieldname): def upload(): """upload data""" global doctype_dl + + webnotes.mute_emails = True + from webnotes.utils.datautils import read_csv_content_from_uploaded_file def bad_template(): @@ -223,6 +226,8 @@ def upload(): webnotes.conn.rollback() else: webnotes.conn.commit() + + webnotes.mute_emails = False return {"messages": ret, "error": error} @@ -298,5 +303,9 @@ def import_doc(d, doctype, overwrite, row_idx): d['__islocal'] = 1 dl = ModelWrapper([webnotes.model.doc.Document(fielddata = d)]) dl.save() + + if webnotes.form_dict.get("_submit")=="on": + dl.submit() + return 'Inserted row (#%d) %s' % (row_idx, getlink(doctype, dl.doc.fields['name'])) From c436e66d7793b0de1202feea748c84f50a9b827b Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 18 Feb 2013 19:15:37 +0530 Subject: [PATCH 03/13] do not allow saving submitted documents --- public/js/wn/misc/datetime.js | 1 + public/js/wn/views/calendar.js | 7 ++++--- webnotes/model/wrapper.py | 3 +++ webnotes/widgets/calendar.py | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/public/js/wn/misc/datetime.js b/public/js/wn/misc/datetime.js index 36378928cb..cc388f2cb5 100644 --- a/public/js/wn/misc/datetime.js +++ b/public/js/wn/misc/datetime.js @@ -40,6 +40,7 @@ $.extend(wn.datetime, { return [double_digit(d.getHours()), double_digit(d.getMinutes()), double_digit(d.getSeconds())].join(":") }, get_datetime_as_string: function(d) { + if(!d) return null; return [d.getFullYear(), double_digit(d.getMonth()+1), double_digit(d.getDate())].join("-") + " " + [double_digit(d.getHours()), double_digit(d.getMinutes()), double_digit(d.getSeconds())].join(":"); } diff --git a/public/js/wn/views/calendar.js b/public/js/wn/views/calendar.js index 262bce7212..2e7cd0b696 100644 --- a/public/js/wn/views/calendar.js +++ b/public/js/wn/views/calendar.js @@ -119,10 +119,10 @@ wn.views.Calendar = Class.extend({ wn.set_route("Form", me.doctype, event.name); }, eventDrop: function(event, dayDelta, minuteDelta, allDay, revertFunc) { - me.update_event(event); + me.update_event(event, revertFunc); }, eventResize: function(event, dayDelta, minuteDelta, allDay, revertFunc) { - me.update_event(event); + me.update_event(event, revertFunc); }, select: function(startDate, endDate, allDay, jsEvent, view) { if(jsEvent.day_clicked && view.name=="month") @@ -180,7 +180,7 @@ wn.views.Calendar = Class.extend({ } }) }, - update_event: function(event) { + update_event: function(event, revertFunc) { var me = this; wn.model.remove_from_locals(me.doctype, event.name); wn.call({ @@ -189,6 +189,7 @@ wn.views.Calendar = Class.extend({ callback: function(r) { if(r.exc) { show_alert("Unable to update event.") + revertFunc(); } } }); diff --git a/webnotes/model/wrapper.py b/webnotes/model/wrapper.py index 0d9fde0923..0286d94793 100644 --- a/webnotes/model/wrapper.py +++ b/webnotes/model/wrapper.py @@ -248,6 +248,9 @@ class ModelWrapper: def save(self, check_links=1): if self.ignore_permissions or webnotes.has_permission(self.doc.doctype, "write", self.doc): self.prepare_for_save(check_links) + if self.doc.docstatus > 0: + self.no_permission_to(_("Save submitted document")) + self.run_method('validate') self.save_main() self.save_children() diff --git a/webnotes/widgets/calendar.py b/webnotes/widgets/calendar.py index a19055c40f..3e53e6f112 100644 --- a/webnotes/widgets/calendar.py +++ b/webnotes/widgets/calendar.py @@ -29,7 +29,7 @@ import json def update_event(args, field_map): args = webnotes._dict(json.loads(args)) field_map = webnotes._dict(json.loads(field_map)) - + w = webnotes.model_wrapper(args.doctype, args.name) w.doc.fields[field_map.start] = args[field_map.start] w.doc.fields[field_map.end] = args[field_map.end] From 5fa2489768decebb87b56ab538c6f229cdb9d7c6 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 18 Feb 2013 19:56:58 +0530 Subject: [PATCH 04/13] added function to copy common fields from one doc to another --- webnotes/model/doc.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/webnotes/model/doc.py b/webnotes/model/doc.py index 8504db1143..531be43105 100755 --- a/webnotes/model/doc.py +++ b/webnotes/model/doc.py @@ -660,4 +660,15 @@ def get(dt, dn='', with_children = 1, from_controller = 0, prefix = 'tab'): def getsingle(doctype): """get single doc as dict""" dataset = webnotes.conn.sql("select field, value from tabSingles where doctype=%s", doctype) - return dict(dataset) \ No newline at end of file + return dict(dataset) + +def copy_common_fields(from_doc, to_doc): + from webnotes.model import default_fields + doctype_list = webnotes.get_doctype(to_doc.doctype) + + for fieldname, value in from_doc.fields.items(): + if fieldname in default_fields: + continue + + if doctype_list.get_field(fieldname) and to_doc.fields[fieldname] != value: + to_doc.fields[fieldname] = value \ No newline at end of file From 9372325f89a359ab4214ee9e8f35fd60b380c8f7 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 19 Feb 2013 07:37:46 +0530 Subject: [PATCH 05/13] fixed in save --- webnotes/model/wrapper.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/webnotes/model/wrapper.py b/webnotes/model/wrapper.py index 0286d94793..0d9fde0923 100644 --- a/webnotes/model/wrapper.py +++ b/webnotes/model/wrapper.py @@ -248,9 +248,6 @@ class ModelWrapper: def save(self, check_links=1): if self.ignore_permissions or webnotes.has_permission(self.doc.doctype, "write", self.doc): self.prepare_for_save(check_links) - if self.doc.docstatus > 0: - self.no_permission_to(_("Save submitted document")) - self.run_method('validate') self.save_main() self.save_children() From 43a7cbb655251bd63f1f313ee0e926ad714436c7 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 19 Feb 2013 07:52:32 +0530 Subject: [PATCH 06/13] do not allow updating a subitted event --- webnotes/widgets/calendar.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webnotes/widgets/calendar.py b/webnotes/widgets/calendar.py index 3e53e6f112..f7ac24cad3 100644 --- a/webnotes/widgets/calendar.py +++ b/webnotes/widgets/calendar.py @@ -31,6 +31,10 @@ def update_event(args, field_map): field_map = webnotes._dict(json.loads(field_map)) w = webnotes.model_wrapper(args.doctype, args.name) + + if w.doc.docstatus == 1: + w.no_permission_to(_("Save a submitted document")) + w.doc.fields[field_map.start] = args[field_map.start] w.doc.fields[field_map.end] = args[field_map.end] w.save() From 158c9ac4ecb691385cbb0dd02ec7e682baf04793 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 19 Feb 2013 08:41:02 +0530 Subject: [PATCH 07/13] fixed: check if submitted before saving --- webnotes/model/wrapper.py | 3 +++ webnotes/test_runner.py | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/webnotes/model/wrapper.py b/webnotes/model/wrapper.py index 0d9fde0923..be21bcee83 100644 --- a/webnotes/model/wrapper.py +++ b/webnotes/model/wrapper.py @@ -247,6 +247,9 @@ class ModelWrapper: def save(self, check_links=1): if self.ignore_permissions or webnotes.has_permission(self.doc.doctype, "write", self.doc): + if self.doc.docstatus == 1: + self.no_permission_to("Save submitted document") + self.prepare_for_save(check_links) self.run_method('validate') self.save_main() diff --git a/webnotes/test_runner.py b/webnotes/test_runner.py index 068de641e0..332c0aa427 100644 --- a/webnotes/test_runner.py +++ b/webnotes/test_runner.py @@ -77,7 +77,15 @@ def make_test_objects(doctype, test_records): if not d.doc.naming_series: d.doc.naming_series = "_T-" + d.doc.doctype + "-" + # submit if docstatus is set to 1 for test record + docstatus = d.doc.docstatus + + d.doc.docstatus = 0 d.insert() + + if docstatus == 1: + d.submit() + records.append(d.doc.name) return records From 987d5f1cbaf2edea327371553d1dcc2927b8cb9d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 19 Feb 2013 08:41:29 +0530 Subject: [PATCH 08/13] fixed: check if submitted before saving --- webnotes/widgets/calendar.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/webnotes/widgets/calendar.py b/webnotes/widgets/calendar.py index f7ac24cad3..46d359d650 100644 --- a/webnotes/widgets/calendar.py +++ b/webnotes/widgets/calendar.py @@ -32,9 +32,6 @@ def update_event(args, field_map): w = webnotes.model_wrapper(args.doctype, args.name) - if w.doc.docstatus == 1: - w.no_permission_to(_("Save a submitted document")) - w.doc.fields[field_map.start] = args[field_map.start] w.doc.fields[field_map.end] = args[field_map.end] w.save() From 5f5813740aa34f973ba9bd79fa7631178da93d9f Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 19 Feb 2013 08:43:38 +0530 Subject: [PATCH 09/13] do not allow submitted/cancelled events to be moved in calendar --- public/js/wn/views/calendar.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/js/wn/views/calendar.js b/public/js/wn/views/calendar.js index 2e7cd0b696..4bcd481aef 100644 --- a/public/js/wn/views/calendar.js +++ b/public/js/wn/views/calendar.js @@ -162,6 +162,10 @@ wn.views.Calendar = Class.extend({ d.id = d.name; d.editable = wn.model.can_write(d.doctype || this.doctype); + // do not allow submitted/cancelled events to be moved / extended + if(d.docstatus && d.docstatus > 0) + d.editable = false; + $.each(me.field_map, function(target, source) { d[target] = d[source]; }); From 545e6938d04b32ba49be83a3a3ace558c820c8f2 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 19 Feb 2013 15:06:40 +0530 Subject: [PATCH 10/13] fixes in reportview, instead of using form_dict, use arg if passed --- webnotes/widgets/reportview.py | 88 +++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 33 deletions(-) diff --git a/webnotes/widgets/reportview.py b/webnotes/widgets/reportview.py index 9eb880d9c1..af4e19fafd 100644 --- a/webnotes/widgets/reportview.py +++ b/webnotes/widgets/reportview.py @@ -41,25 +41,41 @@ def build_query(arg=None): gets doctype, subject, filters limit_start, limit_page_length """ - data = webnotes.form_dict - global tables + data = prepare_data(arg) if 'query' in data: return run_custom_query(data) - filters = json.loads(data['filters']) - fields = json.loads(data['fields']) - tables = get_tables() - load_doctypes() + query = """select %(fields)s from %(tables)s where %(conditions)s + %(group_by)s order by %(order_by)s %(limit)s""" % data + + return query - remove_user_tags(fields) - # conditions - conditions = build_conditions(filters) +def prepare_data(arg=None): + global tables + + if arg: + data = webnotes._dict(arg) + else: + data = webnotes._dict(webnotes.form_dict) + + if 'query' in data: + return data + + if isinstance(data.get("filters"), basestring): + data["filters"] = json.loads(data["filters"]) + if isinstance(data.get("fields"), basestring): + data["fields"] = json.loads(data["fields"]) + + tables = get_tables(data) + load_doctypes() + remove_user_tags(data) + conditions = build_conditions(data) # query dict data['tables'] = ', '.join(tables) data['conditions'] = ' and '.join(conditions) - data['fields'] = ', '.join(fields) + data['fields'] = ', '.join(data.fields) if not data.get('order_by'): data['order_by'] = tables[0] + '.modified desc' @@ -73,10 +89,7 @@ def build_query(arg=None): add_limit(data) - query = """select %(fields)s from %(tables)s where %(conditions)s - %(group_by)s order by %(order_by)s %(limit)s""" % data - - return query + return data def compress(data): """separate keys and values""" @@ -125,12 +138,12 @@ def load_doctypes(): raise webnotes.PermissionError, doctype doctypes[doctype] = webnotes.model.doctype.get(doctype) -def remove_user_tags(fields): +def remove_user_tags(data): """remove column _user_tags if not in table""" - for fld in fields: + for fld in data.fields: if '_user_tags' in fld: - if not '_user_tags' in get_table_columns(webnotes.form_dict['doctype']): - del fields[fields.index(fld)] + if not '_user_tags' in get_table_columns(data.doctype): + del data.fields[data.fields.index(fld)] break def add_limit(data): @@ -139,35 +152,37 @@ def add_limit(data): else: data['limit'] = '' -def build_conditions(filters): +def build_conditions(data): """build conditions""" - data = webnotes.form_dict - # docstatus condition - docstatus = json.loads(data['docstatus']) - if docstatus: - conditions = [tables[0] + '.docstatus in (' + ','.join(docstatus) + ')'] + if isinstance(data.docstatus, basestring): + data.docstatus = json.loads(data.docstatus) + + if data.docstatus: + conditions = [tables[0] + '.docstatus in (' + ','.join(data.docstatus) + ')'] else: # default condition conditions = [tables[0] + '.docstatus < 2'] # make conditions from filters - build_filter_conditions(data, filters, conditions) + build_filter_conditions(data, conditions) # join parent, child tables for tname in tables[1:]: conditions.append(tname + '.parent = ' + tables[0] + '.name') # match conditions - build_match_conditions(data, conditions) + match_conditions = build_match_conditions(data) + if match_conditions: + conditions.append(match_conditions) return conditions -def build_filter_conditions(data, filters, conditions): +def build_filter_conditions(data, conditions): """build conditions from user filters""" from webnotes.utils import cstr - for f in filters: + for f in data.filters: tname = ('`tab' + f[0] + '`') if not tname in tables: tables.append(tname) @@ -185,10 +200,16 @@ def build_filter_conditions(data, filters, conditions): conditions.append('ifnull(' + tname + '.' + f[1] + ",0) " + f[2] \ + " " + cstr(f[3])) -def build_match_conditions(data, conditions): +def build_match_conditions(data): """add match conditions if applicable""" match_conditions = [] match = True + + if not tables or not doctypes: + global tables + tables = get_tables(data) + load_doctypes() + for d in doctypes[data['doctype']]: if d.doctype == 'DocPerm' and d.parent == data['doctype']: if d.role in roles: @@ -208,15 +229,16 @@ def build_match_conditions(data, conditions): match = False if match_conditions and match: - conditions.append('('+ ' or '.join(match_conditions) +')') + return '('+ ' or '.join(match_conditions) +')' -def get_tables(): +def get_tables(data): """extract tables from fields""" - data = webnotes.form_dict tables = ['`tab' + data['doctype'] + '`'] # add tables from fields - for f in json.loads(data['fields']): + for f in data.get('fields') or []: + if "." not in f: continue + table_name = f.split('.')[0] if table_name.lower().startswith('group_concat('): table_name = table_name[13:] From 190e800c0472d1f197a65e666d80a080e49469c8 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 19 Feb 2013 15:07:03 +0530 Subject: [PATCH 11/13] allow All role in permission manager --- core/page/permission_manager/permission_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/page/permission_manager/permission_manager.py b/core/page/permission_manager/permission_manager.py index 74c8f32055..236a9cd84b 100644 --- a/core/page/permission_manager/permission_manager.py +++ b/core/page/permission_manager/permission_manager.py @@ -9,7 +9,7 @@ def get_roles_and_doctypes(): ifnull(issingle,0)=0 and name not in ('DocType')""")], "roles": [d[0] for d in webnotes.conn.sql("""select name from tabRole where name not in - ('All', 'Guest', 'Administrator')""")] + ('Guest', 'Administrator')""")] } @webnotes.whitelist(allow_roles=["System Manager", "Administrator"]) From 4a985248197b1e254e01f61a25b16a9725f934a8 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 19 Feb 2013 15:08:29 +0530 Subject: [PATCH 12/13] minor fixes in meta and datetime --- public/js/legacy/utils/datetime.js | 5 ++++- public/js/wn/model/meta.js | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/public/js/legacy/utils/datetime.js b/public/js/legacy/utils/datetime.js index 675bbb6bdb..14bfa5ca05 100644 --- a/public/js/legacy/utils/datetime.js +++ b/public/js/legacy/utils/datetime.js @@ -165,7 +165,7 @@ wn.datetime = { + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds(); }, - user_to_str: function(d) { + user_to_str: function(d, no_time_str) { var user_fmt = this.get_user_fmt(); var time_str = ''; @@ -193,6 +193,9 @@ wn.datetime = { var d = d.split('-'); var val = d[2]+'-'+d[0]+'-'+d[1]; } + + if(no_time_str)time_str = ''; + return val + time_str; }, diff --git a/public/js/wn/model/meta.js b/public/js/wn/model/meta.js index 889bfb6a31..a7760d3f88 100644 --- a/public/js/wn/model/meta.js +++ b/public/js/wn/model/meta.js @@ -65,7 +65,11 @@ $.extend(wn.meta, { }, get_label: function(dt, fn, dn) { - return this.get_docfield(dt, fn, dn).label || fn; + if(fn==="owner") { + return "Owner"; + } else { + return this.get_docfield(dt, fn, dn).label || fn; + } }, get_print_formats: function(doctype) { From d17c7415cbaa1bfa87b3542fc53fd916d3044a2b Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 19 Feb 2013 15:08:40 +0530 Subject: [PATCH 13/13] fixes in editable calendar --- public/js/wn/views/calendar.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/public/js/wn/views/calendar.js b/public/js/wn/views/calendar.js index 4bcd481aef..f746af0b55 100644 --- a/public/js/wn/views/calendar.js +++ b/public/js/wn/views/calendar.js @@ -115,8 +115,10 @@ wn.views.Calendar = Class.extend({ }, eventClick: function(event, jsEvent, view) { // edit event description or delete - if(wn.model.can_read(me.doctype)) - wn.set_route("Form", me.doctype, event.name); + var doctype = event.doctype || me.doctype; + if(wn.model.can_read(doctype)) { + wn.set_route("Form", doctype, event.name); + } }, eventDrop: function(event, dayDelta, minuteDelta, allDay, revertFunc) { me.update_event(event, revertFunc); @@ -160,19 +162,20 @@ wn.views.Calendar = Class.extend({ var me = this; $.each(events, function(i, d) { d.id = d.name; - d.editable = wn.model.can_write(d.doctype || this.doctype); + d.editable = wn.model.can_write(d.doctype || me.doctype); // do not allow submitted/cancelled events to be moved / extended - if(d.docstatus && d.docstatus > 0) + if(d.docstatus && d.docstatus > 0) { d.editable = false; - + } + $.each(me.field_map, function(target, source) { d[target] = d[source]; }); if(!me.field_map.allDay) d.allDay = 1; - + if(d.status) { if(me.style_map) { $.extend(d, me.styles[me.style_map[d.status]] || {});