Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
c504596c
Commit
c504596c
authored
Dec 15, 2018
by
Boris Kocherov
Committed by
Romain Courteaud
Feb 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_only_office] jslint fix
parent
92624cd3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
44 deletions
+29
-44
bt5/erp5_only_office/SkinTemplateItem/portal_skins/erp5_only_office/onlyoffice/sdkjs/cell/model/FormulaObjects/cubeFunctions.xmla.js.js
.../sdkjs/cell/model/FormulaObjects/cubeFunctions.xmla.js.js
+29
-44
No files found.
bt5/erp5_only_office/SkinTemplateItem/portal_skins/erp5_only_office/onlyoffice/sdkjs/cell/model/FormulaObjects/cubeFunctions.xmla.js.js
View file @
c504596c
/*global AscCommonExcel, RSVP, Xmla, console*/
/* jshint -W040 */
/*
* Copyright (c) 2017 Nexedi SA and Contributors. All Rights Reserved.
...
...
@@ -38,9 +39,8 @@
* @param {Object} RSVP
* @param {Xmla} Xmla
* @param {console} console
* @param {undefined} undefined
*/
function
(
window
,
RSVP
,
Xmla
,
console
,
undefined
)
{
function
(
window
,
RSVP
,
Xmla
,
console
)
{
var
cBaseFunction
=
AscCommonExcel
.
cBaseFunction
;
var
cFormulaFunctionGroup
=
AscCommonExcel
.
cFormulaFunctionGroup
,
cElementType
=
AscCommonExcel
.
cElementType
,
...
...
@@ -66,22 +66,6 @@
cFormulaFunctionGroup
.
NotRealised
.
push
(
cCUBEKPIMEMBER
,
cCUBEMEMBERPROPERTY
,
cCUBERANKEDMEMBER
,
cCUBESET
,
cCUBESETCOUNT
);
var
xmla
=
new
Xmla
({
// listeners: {
// events: Xmla.EVENT_ERROR,
// handler: function (eventName, eventData, xmla) {
// console.log(eventData.exception);
// // alert(
// // "Snap, an error occurred: " + eventData.exception.message + " (" + eventData.exception.code + ")" +
// // (eventData.exception.code === Xmla.Exception.HTTP_ERROR_CDE
// // ? "\nstatus: " + eventData.exception.data.status + "; statusText: " + eventData.exception.data.statusText
// // : "")
// // );
// }
// },
async
:
true
});
function
xmla_request
(
func
,
prop
)
{
var
xmla
=
new
Xmla
({
async
:
true
});
// return function () {
...
...
@@ -364,7 +348,7 @@
};
for
(
axis_id
=
0
;
axis_id
<
axis_count
;
axis_id
++
)
{
for
(
axis_id
=
0
;
axis_id
<
axis_count
;
axis_id
+=
1
)
{
axis_array
.
push
(
dataset
.
getAxis
(
axis_id
));
}
...
...
@@ -441,25 +425,25 @@
var
ret
=
[],
uname
,
level
,
cached_member
;
cached_member
1
;
while
(
r
.
hasMoreRows
())
{
uname
=
r
[
"
getMemberUniqueName
"
]();
level
=
r
[
"
getLevelUniqueName
"
]();
// we can check cache twice because fist check
// only if discover by member_uname
if
(
!
scheme
.
members
.
hasOwnProperty
(
uname
))
{
cached_member
=
{
cached_member
1
=
{
uname
:
uname
,
h
:
r
[
"
getHierarchyUniqueName
"
](),
level
:
r
[
"
getLevelUniqueName
"
](),
caption
:
r
[
"
getMemberCaption
"
](),
type
:
r
[
"
getMemberType
"
]()
};
scheme
.
members
[
uname
]
=
cached_member
;
scheme
.
members
[
uname
]
=
cached_member
1
;
}
else
{
cached_member
=
scheme
.
members
[
uname
];
cached_member
1
=
scheme
.
members
[
uname
];
}
ret
.
push
(
cached_member
);
ret
.
push
(
cached_member
1
);
r
.
nextRow
();
if
(
!
scheme
.
levels
.
hasOwnProperty
(
level
))
{
scheme
.
levels
[
level
]
=
discover_level
(
connection
,
scheme
,
level
);
...
...
@@ -479,15 +463,17 @@
var
i
;
function
compare
(
a
,
b
)
{
if
(
a
.
uname
<
b
.
uname
)
return
-
1
;
if
(
a
.
uname
>
b
.
uname
)
return
1
;
if
(
a
.
uname
<
b
.
uname
)
{
return
-
1
;
}
if
(
a
.
uname
>
b
.
uname
)
{
return
1
;
}
return
0
;
}
members
.
sort
(
compare
);
for
(
i
=
0
;
i
<
members
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
members
.
length
;
i
+=
1
)
{
members
[
i
].
level_index
=
i
;
}
scheme
.
levels
[
level
]
=
members
;
...
...
@@ -501,9 +487,8 @@
function
check_interseption
(
hierarchy
)
{
if
(
hierarchies
.
hasOwnProperty
(
hierarchy
))
{
throw
"
The tuple is invalid because there is no intersection for the specified values.
"
;
}
else
{
hierarchies
[
hierarchy
]
=
1
;
}
hierarchies
[
hierarchy
]
=
1
;
}
members
.
forEach
(
function
(
member
)
{
...
...
@@ -514,11 +499,11 @@
member_uname
:
member
})
.
push
(
function
(
members
)
{
var
m
ember
;
var
m
;
if
(
members
.
length
>
0
)
{
m
ember
=
members
[
0
];
check_interseption
(
m
ember
.
h
);
return
m
ember
;
m
=
members
[
0
];
check_interseption
(
m
.
h
);
return
m
;
}
else
{
throw
"
member not found
"
;
}
...
...
@@ -608,7 +593,7 @@
member
,
new_member
,
level
;
for
(
i
=
0
;
i
<
arg
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
arg
.
length
;
i
+=
1
)
{
elem
=
arg
[
i
];
if
(
cElementType
.
string
===
elem
.
type
)
{
member
=
scheme
.
members
[
elem
.
value
];
...
...
@@ -735,25 +720,25 @@
ret
;
function
getHierarchyByMember
(
member_path
)
{
var
h
;
h
=
cube
.
members
[
member_path
];
if
(
h
===
undefined
)
{
var
h
ierarchy
;
h
ierarchy
=
cube
.
members
[
member_path
];
if
(
h
ierarchy
===
undefined
)
{
throw
"
query result not contain data for member:
"
+
member_path
;
}
h
=
h
.
hierarchy
;
h
=
cube
.
hierarchies
[
h
];
return
h
;
h
ierarchy
=
hierarchy
.
hierarchy
;
h
ierarchy
=
cube
.
hierarchies
[
hierarchy
];
return
h
ierarchy
;
}
for
(
i
=
0
;
i
<
cube
.
hierarchies
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
cube
.
hierarchies
.
length
;
i
+=
1
)
{
h
=
cube
.
hierarchies
[
i
];
if
(
!
coordinate
[
h
.
axis_id
])
{
coordinate
[
h
.
axis_id
]
=
[];
}
coordinate
[
h
.
axis_id
][
h
.
tuple_id
]
=
null
;
}
for
(
i
=
0
;
i
<
members
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
members
.
length
;
i
+=
1
)
{
member_path
=
members
[
i
];
h
=
getHierarchyByMember
(
members
[
i
]);
coordinate
[
h
.
axis_id
][
h
.
tuple_id
]
=
member_path
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment