diff --git a/core/doctype/report/report.txt b/core/doctype/report/report.txt index 6914995ad5..9d8bf049b1 100644 --- a/core/doctype/report/report.txt +++ b/core/doctype/report/report.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - u'creation': '2012-06-13 19:07:26', + u'creation': '2012-10-02 15:44:56', u'docstatus': 0, - u'modified': '2012-10-01 17:58:19', + u'modified': '2012-10-04 17:30:52', u'modified_by': u'Administrator', u'owner': u'Administrator' }, @@ -85,7 +85,8 @@ { 'cancel': 1, u'doctype': u'DocPerm', - 'role': u'Administrator' + 'role': u'Administrator', + 'write': 1 }, # DocPerm @@ -100,7 +101,8 @@ { 'cancel': 1, u'doctype': u'DocPerm', - 'role': u'Report Manager' + 'role': u'Report Manager', + 'write': 1 }, # DocPerm diff --git a/public/js/wn/misc/utils.js b/public/js/wn/misc/utils.js new file mode 100644 index 0000000000..1e0c4d76c1 --- /dev/null +++ b/public/js/wn/misc/utils.js @@ -0,0 +1,23 @@ +wn.provide('wn.utils'); + +wn.utils.comma_or = function(list) { + return wn.utils.comma_sep(list, " or "); +} + +wn.utils.comma_and = function(list) { + return wn.utils.comma_sep(list, " and "); +} + +wn.utils.comma_sep = function(list, sep) { + if(list instanceof Array) { + if(list.length==0) { + return ""; + } else if (list.length==1) { + return list[0]; + } else { + return list.slice(0, list.length-1).join(", ") + sep + list.slice(-1)[0]; + } + } else { + return list; + } +} \ No newline at end of file diff --git a/public/js/wn/views/query_report.js b/public/js/wn/views/query_report.js index 899e6e36dc..241e98824c 100644 --- a/public/js/wn/views/query_report.js +++ b/public/js/wn/views/query_report.js @@ -413,8 +413,11 @@ wn.views.QueryReport = Class.extend({ }); }, export: function() { - wn.downloadify(wn.slickgrid_tools.get_view_data(this.columns, this.dataView), - ["Report Manager", "System Manager"]); - return false; + var result = $.map(wn.slickgrid_tools.get_view_data(this.columns, this.dataView), + function(row) { + return [row.splice(1)]; + }); + wn.downloadify(result, ["Report Manager", "System Manager"]); + return false; } }) \ No newline at end of file