Commit 25a61b45 authored by Boris Kocherov's avatar Boris Kocherov

[erp5_only_office] xmla: remove badly optimization

parent 6c5da7d4
...@@ -121,6 +121,16 @@ ...@@ -121,6 +121,16 @@
return queue; return queue;
} }
function row2member(row) {
return {
uname: row.getMemberUniqueName(),
level: row.getLevelUniqueName(),
h: row.getHierarchyUniqueName(),
caption: row.getMemberCaption(),
type: row.getMemberType()
};
}
rJS(window) rJS(window)
.ready(function () { .ready(function () {
var g = this; var g = this;
...@@ -269,13 +279,7 @@ ...@@ -269,13 +279,7 @@
if (level_uname !== r["getLevelUniqueName"]()) { if (level_uname !== r["getLevelUniqueName"]()) {
throw "xmla server fail"; throw "xmla server fail";
} }
member = { member = row2member(r);
uname: uname,
level: level_uname,
h: r["getHierarchyUniqueName"](),
caption: r["getMemberCaption"](),
type: r["getMemberType"]()
};
r.nextRow(); r.nextRow();
cache.members[uname] = member; cache.members[uname] = member;
members.push(member); members.push(member);
...@@ -323,17 +327,12 @@ ...@@ -323,17 +327,12 @@
}, connection_name) }, connection_name)
.push(function (r) { .push(function (r) {
if (r.rowCount() === 0) { if (r.rowCount() === 0) {
return;
}
return g.getMembersOnLevel(connection_name, r["getLevelUniqueName"]());
})
.push(function (members) {
if (!members) {
delete cache.members[memeber_uname]; delete cache.members[memeber_uname];
// cache.members[memeber_uname] = false;
return; return;
} }
return cache.members[memeber_uname]; var member = row2member(r);
cache.members[memeber_uname] = member;
return member;
}) })
.push(undefined, function (err) { .push(undefined, function (err) {
delete cache.members[memeber_uname]; delete cache.members[memeber_uname];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment