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
Show 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 */
/* jshint -W040 */
/*
/*
* Copyright (c) 2017 Nexedi SA and Contributors. All Rights Reserved.
* Copyright (c) 2017 Nexedi SA and Contributors. All Rights Reserved.
...
@@ -38,9 +39,8 @@
...
@@ -38,9 +39,8 @@
* @param {Object} RSVP
* @param {Object} RSVP
* @param {Xmla} Xmla
* @param {Xmla} Xmla
* @param {console} console
* @param {console} console
* @param {undefined} undefined
*/
*/
function
(
window
,
RSVP
,
Xmla
,
console
,
undefined
)
{
function
(
window
,
RSVP
,
Xmla
,
console
)
{
var
cBaseFunction
=
AscCommonExcel
.
cBaseFunction
;
var
cBaseFunction
=
AscCommonExcel
.
cBaseFunction
;
var
cFormulaFunctionGroup
=
AscCommonExcel
.
cFormulaFunctionGroup
,
var
cFormulaFunctionGroup
=
AscCommonExcel
.
cFormulaFunctionGroup
,
cElementType
=
AscCommonExcel
.
cElementType
,
cElementType
=
AscCommonExcel
.
cElementType
,
...
@@ -66,22 +66,6 @@
...
@@ -66,22 +66,6 @@
cFormulaFunctionGroup
.
NotRealised
.
push
(
cCUBEKPIMEMBER
,
cCUBEMEMBERPROPERTY
,
cCUBERANKEDMEMBER
,
cFormulaFunctionGroup
.
NotRealised
.
push
(
cCUBEKPIMEMBER
,
cCUBEMEMBERPROPERTY
,
cCUBERANKEDMEMBER
,
cCUBESET
,
cCUBESETCOUNT
);
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
)
{
function
xmla_request
(
func
,
prop
)
{
var
xmla
=
new
Xmla
({
async
:
true
});
var
xmla
=
new
Xmla
({
async
:
true
});
// return function () {
// return function () {
...
@@ -364,7 +348,7 @@
...
@@ -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
));
axis_array
.
push
(
dataset
.
getAxis
(
axis_id
));
}
}
...
@@ -441,25 +425,25 @@
...
@@ -441,25 +425,25 @@
var
ret
=
[],
var
ret
=
[],
uname
,
uname
,
level
,
level
,
cached_member
;
cached_member
1
;
while
(
r
.
hasMoreRows
())
{
while
(
r
.
hasMoreRows
())
{
uname
=
r
[
"
getMemberUniqueName
"
]();
uname
=
r
[
"
getMemberUniqueName
"
]();
level
=
r
[
"
getLevelUniqueName
"
]();
level
=
r
[
"
getLevelUniqueName
"
]();
// we can check cache twice because fist check
// we can check cache twice because fist check
// only if discover by member_uname
// only if discover by member_uname
if
(
!
scheme
.
members
.
hasOwnProperty
(
uname
))
{
if
(
!
scheme
.
members
.
hasOwnProperty
(
uname
))
{
cached_member
=
{
cached_member
1
=
{
uname
:
uname
,
uname
:
uname
,
h
:
r
[
"
getHierarchyUniqueName
"
](),
h
:
r
[
"
getHierarchyUniqueName
"
](),
level
:
r
[
"
getLevelUniqueName
"
](),
level
:
r
[
"
getLevelUniqueName
"
](),
caption
:
r
[
"
getMemberCaption
"
](),
caption
:
r
[
"
getMemberCaption
"
](),
type
:
r
[
"
getMemberType
"
]()
type
:
r
[
"
getMemberType
"
]()
};
};
scheme
.
members
[
uname
]
=
cached_member
;
scheme
.
members
[
uname
]
=
cached_member
1
;
}
else
{
}
else
{
cached_member
=
scheme
.
members
[
uname
];
cached_member
1
=
scheme
.
members
[
uname
];
}
}
ret
.
push
(
cached_member
);
ret
.
push
(
cached_member
1
);
r
.
nextRow
();
r
.
nextRow
();
if
(
!
scheme
.
levels
.
hasOwnProperty
(
level
))
{
if
(
!
scheme
.
levels
.
hasOwnProperty
(
level
))
{
scheme
.
levels
[
level
]
=
discover_level
(
connection
,
scheme
,
level
);
scheme
.
levels
[
level
]
=
discover_level
(
connection
,
scheme
,
level
);
...
@@ -479,15 +463,17 @@
...
@@ -479,15 +463,17 @@
var
i
;
var
i
;
function
compare
(
a
,
b
)
{
function
compare
(
a
,
b
)
{
if
(
a
.
uname
<
b
.
uname
)
if
(
a
.
uname
<
b
.
uname
)
{
return
-
1
;
return
-
1
;
if
(
a
.
uname
>
b
.
uname
)
}
if
(
a
.
uname
>
b
.
uname
)
{
return
1
;
return
1
;
}
return
0
;
return
0
;
}
}
members
.
sort
(
compare
);
members
.
sort
(
compare
);
for
(
i
=
0
;
i
<
members
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
members
.
length
;
i
+=
1
)
{
members
[
i
].
level_index
=
i
;
members
[
i
].
level_index
=
i
;
}
}
scheme
.
levels
[
level
]
=
members
;
scheme
.
levels
[
level
]
=
members
;
...
@@ -501,9 +487,8 @@
...
@@ -501,9 +487,8 @@
function
check_interseption
(
hierarchy
)
{
function
check_interseption
(
hierarchy
)
{
if
(
hierarchies
.
hasOwnProperty
(
hierarchy
))
{
if
(
hierarchies
.
hasOwnProperty
(
hierarchy
))
{
throw
"
The tuple is invalid because there is no intersection for the specified values.
"
;
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
)
{
members
.
forEach
(
function
(
member
)
{
...
@@ -514,11 +499,11 @@
...
@@ -514,11 +499,11 @@
member_uname
:
member
member_uname
:
member
})
})
.
push
(
function
(
members
)
{
.
push
(
function
(
members
)
{
var
m
ember
;
var
m
;
if
(
members
.
length
>
0
)
{
if
(
members
.
length
>
0
)
{
m
ember
=
members
[
0
];
m
=
members
[
0
];
check_interseption
(
m
ember
.
h
);
check_interseption
(
m
.
h
);
return
m
ember
;
return
m
;
}
else
{
}
else
{
throw
"
member not found
"
;
throw
"
member not found
"
;
}
}
...
@@ -608,7 +593,7 @@
...
@@ -608,7 +593,7 @@
member
,
member
,
new_member
,
new_member
,
level
;
level
;
for
(
i
=
0
;
i
<
arg
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
arg
.
length
;
i
+=
1
)
{
elem
=
arg
[
i
];
elem
=
arg
[
i
];
if
(
cElementType
.
string
===
elem
.
type
)
{
if
(
cElementType
.
string
===
elem
.
type
)
{
member
=
scheme
.
members
[
elem
.
value
];
member
=
scheme
.
members
[
elem
.
value
];
...
@@ -735,25 +720,25 @@
...
@@ -735,25 +720,25 @@
ret
;
ret
;
function
getHierarchyByMember
(
member_path
)
{
function
getHierarchyByMember
(
member_path
)
{
var
h
;
var
h
ierarchy
;
h
=
cube
.
members
[
member_path
];
h
ierarchy
=
cube
.
members
[
member_path
];
if
(
h
===
undefined
)
{
if
(
h
ierarchy
===
undefined
)
{
throw
"
query result not contain data for member:
"
+
throw
"
query result not contain data for member:
"
+
member_path
;
member_path
;
}
}
h
=
h
.
hierarchy
;
h
ierarchy
=
hierarchy
.
hierarchy
;
h
=
cube
.
hierarchies
[
h
];
h
ierarchy
=
cube
.
hierarchies
[
hierarchy
];
return
h
;
return
h
ierarchy
;
}
}
for
(
i
=
0
;
i
<
cube
.
hierarchies
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
cube
.
hierarchies
.
length
;
i
+=
1
)
{
h
=
cube
.
hierarchies
[
i
];
h
=
cube
.
hierarchies
[
i
];
if
(
!
coordinate
[
h
.
axis_id
])
{
if
(
!
coordinate
[
h
.
axis_id
])
{
coordinate
[
h
.
axis_id
]
=
[];
coordinate
[
h
.
axis_id
]
=
[];
}
}
coordinate
[
h
.
axis_id
][
h
.
tuple_id
]
=
null
;
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
];
member_path
=
members
[
i
];
h
=
getHierarchyByMember
(
members
[
i
]);
h
=
getHierarchyByMember
(
members
[
i
]);
coordinate
[
h
.
axis_id
][
h
.
tuple_id
]
=
member_path
;
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