diff --git a/config.json b/config.json
index 4c93bafc7f..0099957b97 100644
--- a/config.json
+++ b/config.json
@@ -1,6 +1,6 @@
{
"base_template": "lib/website/templates/base.html",
- "framework_version": "3.7.1",
+ "framework_version": "3.7.2",
"modules": {
"Calendar": {
"color": "#2980b9",
diff --git a/public/js/wn/print/print_table.js b/public/js/wn/print/print_table.js
index 6f3f3160c5..8fb33ccf4b 100644
--- a/public/js/wn/print/print_table.js
+++ b/public/js/wn/print/print_table.js
@@ -53,13 +53,13 @@ wn.print.Table = Class.extend({
}
});
});
-
+
var columns = [],
widths = [],
head_labels = [];
// make new arrays to remove empty cols, widths and head labels
- $.each(cols_with_value, function(i, col_idx) {
+ $.each(cols_with_value.sort(), function(i, col_idx) {
columns.push(me.columns[col_idx]);
me.widths && widths.push(me.widths[col_idx]);
me.head_labels && head_labels.push(me.head_labels[col_idx]);
diff --git a/public/js/wn/ui/editor.js b/public/js/wn/ui/editor.js
index 2448b69d2c..c1d6d705b5 100644
--- a/public/js/wn/ui/editor.js
+++ b/public/js/wn/ui/editor.js
@@ -123,8 +123,10 @@ bsEditor = Class.extend({
},
clean_html: function() {
+
var html = this.editor.html() || "";
- html = html.replace(/(
|\s|
<\/div>| )*$/, '');
+ if(!strip(this.editor.text())) html = "";
+ // html = html.replace(/(
|\s|
<\/div>| )*$/, '');
// remove custom typography (use CSS!)
if(this.options.remove_typography) {
diff --git a/public/js/wn/views/listview.js b/public/js/wn/views/listview.js
index cf89dfde0a..fc2b70573f 100644
--- a/public/js/wn/views/listview.js
+++ b/public/js/wn/views/listview.js
@@ -87,25 +87,26 @@ wn.views.ListView = Class.extend({
var overridden = $.map(this.settings.add_columns || [], function(d) {
return d.content;
});
+ var docfields_in_list_view = wn.model.get("DocField", {"parent":this.doctype,
+ "in_list_view":1}).sort(function(a, b) { return a.idx - b.idx })
- $.each(wn.model.get("DocField", {"parent":this.doctype, "in_list_view":1}),
- function(i,d) {
- if(in_list(overridden, d.fieldname)) {
- return;
- }
- // field width
- var colspan = "3";
- if(in_list(["Int", "Percent", "Select"], d.fieldtype)) {
- colspan = "2";
- } else if(d.fieldtype=="Check") {
- colspan = "1";
- } else if(in_list(["name", "subject", "title"], d.fieldname)) { // subjects are longer
- colspan = "4";
- } else if(d.fieldtype=="Text Editor" || d.fieldtype=="Text") {
- colspan = "4";
- }
- me.columns.push({colspan: colspan, content: d.fieldname,
- type:d.fieldtype, df:d, title:wn._(d.label) });
+ $.each(docfields_in_list_view, function(i,d) {
+ if(in_list(overridden, d.fieldname)) {
+ return;
+ }
+ // field width
+ var colspan = "3";
+ if(in_list(["Int", "Percent", "Select"], d.fieldtype)) {
+ colspan = "2";
+ } else if(d.fieldtype=="Check") {
+ colspan = "1";
+ } else if(in_list(["name", "subject", "title"], d.fieldname)) { // subjects are longer
+ colspan = "4";
+ } else if(d.fieldtype=="Text Editor" || d.fieldtype=="Text") {
+ colspan = "4";
+ }
+ me.columns.push({colspan: colspan, content: d.fieldname,
+ type:d.fieldtype, df:d, title:wn._(d.label) });
});
// additional columns
diff --git a/public/js/wn/views/reportview.js b/public/js/wn/views/reportview.js
index 5dbde7c412..d4b8c627e5 100644
--- a/public/js/wn/views/reportview.js
+++ b/public/js/wn/views/reportview.js
@@ -38,10 +38,16 @@ wn.views.ReportViewPage = Class.extend({
});
},
make_page: function() {
+ var me = this;
this.page = wn.container.add_page(this.page_name);
wn.ui.make_app_page({parent:this.page,
single_column:true});
wn.container.change_to(this.page_name);
+
+ $(this.page).on('show', function(){
+ if(me.page.reportview.set_route_filters())
+ me.page.reportview.run();
+ })
},
make_report_view: function() {
var module = locals.DocType[this.doctype].module;
@@ -147,10 +153,12 @@ wn.views.ReportView = wn.ui.Listing.extend({
set_route_filters: function() {
var me = this;
if(wn.route_options) {
+ me.filter_list.clear_filters();
$.each(wn.route_options, function(key, value) {
me.filter_list.add_filter(me.doctype, key, "=", value);
});
wn.route_options = null;
+ return true;
}
},