OXIESEC PANEL
- Current Dir:
/
/
home
/
cubot
/
docroot
/
showcase
/
js
/
app
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
12/31/2022 06:53:36 AM
rwxr-xr-x
📁
.svn
-
08/14/2022 11:05:11 AM
rwxr-xr-x
📄
chartPrefs.js
14.32 KB
08/14/2022 11:05:11 AM
rw-r--r--
📄
compute.js
6.11 KB
08/14/2022 11:05:11 AM
rw-r--r--
📄
filterClass.js
4.91 KB
08/14/2022 11:05:11 AM
rw-r--r--
📄
filter_template.js
72.65 KB
08/14/2022 11:05:11 AM
rw-r--r--
📄
ws.app.js
18.87 KB
08/14/2022 11:05:11 AM
rw-r--r--
📄
ws.lib.js
24.63 KB
08/14/2022 11:05:11 AM
rw-r--r--
Editing: ws.lib.js
Close
function setCookie(c_name,value,exdays) { var exdate=new Date(); exdate.setDate(exdate.getDate() + exdays); var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString()); document.cookie=c_name + "=" + c_value; } function getCookie(c_name) { var i,x,y,ARRcookies=document.cookie.split(";"); for (i=0;i<ARRcookies.length;i++) { x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("=")); y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1); x=x.replace(/^\s+|\s+$/g,""); if (x==c_name) { return unescape(y); } } } /*Array.prototype.max = function() { var max = this[0]; var len = this.length; for (var i = 1; i < len; i++) if (this[i] > max) max = this[i]; return max; } Array.prototype.min = function() { var min = this[0]; var len = this.length; for (var i = 1; i < len; i++) if (this[i] < min) min = this[i]; return min; }*/ function isTimeColumn(Column){ if(Column== "month" || Column=="finmth" || Column == "quarter" || Column == "finqtr" || Column == "week" || Column == "dayofweek") return true; else return false; } function convertToDisplay(value, Column){ Column=Column.toLowerCase(); if(isTimeColumn(Column)) return decodeTime(Column, value); else return value; } function decodeTime(type, value){ var month = ['','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; var finMonthArray = ['','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec','Jan','Feb','Mar']; var quarter = ['','Qtr-1','Qtr-2','Qtr-3','Qtr-4']; var weekdays =['','Monday','Tuesday','Wednesday','Thursday','Friday', 'Saturday', 'Sunday']; if(type == "month") return month[value]; if(type == "finmth") return finMonthArray[value]; else if(type == "quarter" || type == "finqtr") return quarter[value]; else if(type == "dayofweek") return weekdays[value]; else if(type == "week") return "Week-"+value; return value; } function encodeTime(type, value){ var month = new Array(); month['Jan'] = 1; month['Feb'] = 2; month['Mar'] = 3; month['Apr'] = 4; month['May'] = 5; month['Jun'] = 6; month['Jul'] = 7; month['Aug'] = 8; month['Sep'] = 9; month['Oct'] = 10; month['Nov'] = 11; month['Dec'] = 12; var quarter = new Array(); quarter['Qtr-1'] = 1; quarter['Qtr-2'] = 2; quarter['Qtr-3'] = 3; quarter['Qtr-4'] = 4; var weekdays = new Array(); weekdays['Monday'] = 1; weekdays['Tuesday'] = 2; weekdays['Wednesday'] = 3; weekdays['Thursday'] = 4; weekdays['Friday'] = 5; weekdays['Saturday'] = 6; weekdays['Sunday'] = 7; if(type == "month") return month[value]; else if(type == "quarter") return quarter[value]; else if(type == "dayofweek") return weekdays[value]; return value; } function decodeFormat(format){ if(format == 'B'){ return "bar"; }else if(format == 'L' ){ return "line"; }else if(format == 'P' ){ return "pie"; }else if(format == 'A' ){ return "area"; }else if(format == 'S' ){ return "stack"; } else{ return format; } } function encodeFormat(format){ if(format == 'Bar'){ return "B"; }else if(format == 'Line' ){ return "L"; }else if(format == 'Pie' ){ return "P"; }else if(format == 'Stack Bar'){ return "S"; }else if(format == 'Column'){ return "N"; }else if(format == 'Combo'){ return "C"; }else if(format == 'WaterFall'){ return "4"; }else if(format == 'Area'){ return "5"; }else if(format == 'Sipder Web'){ return "6"; }else if(format == 'Bubble'){ return "7"; }else if(format == 'Scatter'){ return "R"; }else if(format == 'Gauge'){ return "G"; }else if(format == 'Map'){ return "M"; }else if(format == 'SVG'){ return "SVG"; }else if(format == 'Text'){ return "T"; }else{ return format; } } function decodeoper(oper){ if (oper == "bw") return "Between"; else if (oper == "gt") return ">"; else if (oper == "lt") return "<"; else if (oper == "ne") return "!="; else if (oper == "lk") return "Like"; else if (oper == "ge") return ">="; else if (oper == "le") return "<="; else if (oper == "nb") return "Not Between"; else if (oper == "td") return "TD"; else return "="; } function sort_unique(arr) { arr = arr.sort(function (a, b) { return a*1 - b*1; }); var ret = [arr[0]]; for (var i = 1; i < arr.length; i++) { // start loop at 1 as element 0 can never be a duplicate if (arr[i-1] !== arr[i]) { ret.push(arr[i]); } } return ret; } function formatReportData(ReportData, dims, layout, topn){ var monthArray = ['','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; var finMonthArray = ['','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec','Jan','Feb','Mar']; var quarterArray=['','Qtr-1','Qtr-2','Qtr-3','Qtr-4']; var mIndex=-1, fIndex=-1, qIndex=-1, wIndex=-1; var i=0; var j=0; var ndims=0, tmpstr; var nrows=ReportData.length; var ncols=ReportData[0].length; var dimLen=dims.length; if(layout == "CrossTab" && dimLen>1) dimLen=dimLen-1; for ( i = 0; i < dimLen; i++) { if (dims[i] == "month"){ mIndex = i; } if (dims[i] == "quarter" || dims[i] == "finqtr"){ qIndex = i; } if (dims[i] == "finmth"){ fIndex = i; } if (dims[i] == "week"){ wIndex = i; } } for ( i = 1; i < nrows; i++) { //i=1 because leaving heading in ReportData if(mIndex > -1 && parseInt(ReportData[i][mIndex]) >0 && parseInt(ReportData[i][mIndex]) <=12 ){ ReportData[i][mIndex] = monthArray[ReportData[i][mIndex]]; } if(qIndex > -1 && parseInt(ReportData[i][qIndex]) >0 && parseInt(ReportData[i][qIndex]) <=5){ ReportData[i][qIndex] = quarterArray[ReportData[i][qIndex]]; } if(fIndex > -1 && parseInt(ReportData[i][fIndex]) >0 && parseInt(ReportData[i][fIndex]) <=12){ ReportData[i][fIndex] = finMonthArray[ReportData[i][fIndex]]; } if(wIndex > -1 && parseInt(ReportData[i][wIndex]) >=0){ ReportData[i][wIndex] = 'Week-'+ReportData[i][wIndex]; } } for( i=1; i<nrows; i++){ for( j=ndims; j<ReportData[i].length; j++){ if(ReportData[i][j]=="") ReportData[i][j]=0; } } if(layout == "CrossTab"){ ndims=dims.length; if(dims[ndims -1] == "month"){ for( j=ndims-1; j<ncols; j++){ var tmpArray=ReportData[0][j].split("~_"); tmpstr=monthArray[tmpArray[0]]; if(tmpstr) tmpArray[0]=tmpstr; ReportData[0][j]=tmpArray.join(" "); } } else if(dims[ndims -1] == "finmth"){ for( j=ndims-1; j<ncols; j++){ var tmpArray=ReportData[0][j].split("~_"); tmpstr=finMonthArray[tmpArray[0]]; if(tmpstr) tmpArray[0]=tmpstr; ReportData[0][j]=tmpArray.join(" "); } } else if(dims[ndims -1] == "quarter" || dims[ndims -1] == "finqtr"){ for( j=ndims-1; j<ncols; j++){ var tmpArray=ReportData[0][j].split("~_"); tmpstr=quarterArray[tmpArray[0]]; if(tmpstr) tmpArray[0]=tmpstr; ReportData[0][j]=tmpArray.join(" "); } } else if(dims[ndims -1] == "week"){ for( j=ndims-1; j<ncols; j++){ var tmpArray=ReportData[0][j].split("~_"); tmpstr="Week-"+tmpArray[0]; if(tmpstr) tmpArray[0]=tmpstr; ReportData[0][j]=tmpArray.join(" "); } } else{ for( j=ndims-1; j<ncols; j++){ var tmpArray=ReportData[0][j].split("~_"); ReportData[0][j]=tmpArray.join(" "); } } } //Handling Rest Totals for topx reports if(topn > 0 && userLanguage!="English"){ for(i=topn; i<nrows;){ if(ReportData[i+1][dimLen-1].indexOf("Rest(") >=0) ReportData[i+1][dimLen-1]=getLabel("Rest Total"); i=i+topn+1; } } return ReportData; } function unique(dimArray) { var uniqArray = []; var l = dimArray.length; for(var i=0; i<l; i++) { for(var j=i+1; j<l; j++) { if (dimArray[i] === dimArray[j]) j = ++i; } uniqArray.push(dimArray[i]); } return uniqArray; }; /* * * Function to make normal report data to crosstab report data * */ function makeXtab(DataTable){ var i=0, j=0; var Hash= new Array(); var Dim1= new Array(); var Dim2= new Array(); for(i=1; i<DataTable.length; i++){ Dim1.push(DataTable[i][0]); Dim2.push(DataTable[i][1]); } Dim1=unique(Dim1.sort()); Dim2=unique(Dim2.sort()); for(i=1; i<DataTable.length; i++){ str=DataTable[i][0]+":"+DataTable[i][1]; Hash[str]=DataTable[i][2]; } var col_values=new Array(Dim1.length+1); col_values[0]=new Array(Dim2.length+1); col_values[0][0]=DataTable[0][0]; for(i=0; i<Dim1.length; i++){ col_values[i+1]=new Array(Dim2.length+1); col_values[i+1][0]=Dim1[i]; for(j=0; j<Dim2.length; j++){ col_values[0][j+1]=Dim2[j]+"~_"+DataTable[0][2]; if(Hash[Dim1[i]+":"+Dim2[j]]) col_values[i+1][j+1]=Hash[Dim1[i]+":"+Dim2[j]]; else col_values[i+1][j+1]=0; } } return col_values; } /* * *Revert report data. Row to column and column to row to display crosstab reports like CUBOT is showing. * */ function revertRowColumn(DataTable, measure){ var col_values=new Array(DataTable[0].length); for(i=0; i<DataTable[0].length; i++){ col_values[i]=new Array(DataTable.length-1); DataTable[0][i]=DataTable[0][i].replace(measure,''); } for(i=0; i<DataTable.length; i++){ for(j=0; j<DataTable[i].length; j++){ col_values[j][i]=DataTable[i][j]; } } for(i=1; i<=DataTable.length-1; i++){ col_values[0][i]=col_values[0][i]+' '+measure; } return col_values; } /* * Check if value exists in the array * */ function ifExists(valArray, currentValue){ if(typeof valArray == 'undefined' || valArray.length<1) return false; for(var i=0; i<valArray.length; i++){ if(valArray[i] == currentValue) return true; } return false; } /* * Get the operator combo */ function getFilterOperatorCombo(itemId, operator){ var htmlStr='<select itemId="'+itemId+'" class=filterOperator>'; htmlStr+='<option value="eq">Equals to</option>'; htmlStr+='<option value="bw">Between</option>'; htmlStr+='<option value="gt">Greater then</option>'; htmlStr+='<option value="lt">Less then</option>'; htmlStr+='<option value="ne">Not Equals</option>'; htmlStr+='<option value="lk">Like</option>'; htmlStr+='<option value="ge">Greater then Equals</option>'; htmlStr+='<option value="le">Less then Equals</option>'; htmlStr+='<option value="nb">Not Between</option>'; htmlStr+='<option value="td">Till Date</option>'; htmlStr+='</select>'; htmlStr=htmlStr.replace('value="'+operator+'"', 'value="'+operator+'" selected="selected"'); return htmlStr; } /* * */ function printItemList(authToken, myfunc){ var metaDataCollection=createItemList(authToken); var item=""; a = new dTree('a'); a.config.useStatusText=true; a.config.closeSameLevel=false; a.config.useCookies=false; a.config.target=""; /* add(id, pid, name, url, url_addnew, url_sort, url_delete, role, table, title, target, icon, iconOPen, isopen);*/ a.add("0", "0", "Dimension"); for(var i=0; i<metaDataCollection.dimensionTree.length; i++){ item = metaDataCollection.dimensionTree[i]; a.add(item.Id, item.ParentId, item.Name); for(var j=0; j<metaDataCollection.dimensionTree[i].items.length; j++){ item = metaDataCollection.dimensionTree[i].items[j]; a.add(item.Id, item.ParentId, item.Name, "javascript:"+myfunc+"("+item.Id+",'"+item.Name+"','"+item.Column+"')"); } } a.add("10000", "10000", "Measures"); for(var i=0; i<metaDataCollection.measureTree.length; i++){ item = metaDataCollection.measureTree[i]; a.add(item.Id, item.ParentId, item.Name); for(var j=0; j<metaDataCollection.measureTree[i].items.length; j++){ item = metaDataCollection.measureTree[i].items[j]; a.add(item.Id, item.ParentId, item.Name, "javascript:"+myfunc+"("+item.Id+",'"+item.Name+"')"); } } a.add("50000", "50000", "Targets"); for(var i=0; i<metaDataCollection.targetTree.length; i++){ item = metaDataCollection.targetTree[i]; a.add(item.Id, item.ParentId, item.Name, "javascript:"+myfunc+"("+item.Id+",'"+item.Name+"')"); for(var j=0; (typeof metaDataCollection.targetTree[i].items != "undefined" && j<metaDataCollection.targetTree[i].items.length); j++){ item = metaDataCollection.targetTree[i].items[j]; a.add(item.Id, item.ParentId, item.Name, "javascript:"+myfunc+"("+item.Id+",'"+item.Name+"')"); } } return a; } function isstring(val){ if(typeof val == "undefined" || val=="") return false; return true; } function getFormatValue(format, pointer){ var index = format.indexOf(pointer); var val=''; if(index >=0) val=format.substr(index + 1, 1); return val; } function openDialog(Id, Height, Width, Title, htmlstr, applyFunc, params1, params2){ if(Height==""){ Height=getMheight(); Height=(Height-(Height*.2)); } if(Width == ""){ Width=getMwidth(); Width=(Width-(Width*.2)); } $("#"+Id).dialog({ title:Title, height:Height, width: Width, modal: true, resizable: true, autoResize: false, autoOpen: false, position:['center',50], buttons: [ { text: "Apply", click: function() {applyFunc(params1, params2)} } ] }); $("#"+Id).html(htmlstr).dialog("open"); } /* * * Get view port width. Helpful as resolution differs for different monitor. * */ function getMwidth(){ var viewportwidth; if (typeof window.innerWidth != 'undefined') { viewportwidth = window.innerWidth; } else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) { viewportwidth = document.documentElement.clientWidth; } else { viewportwidth = document.getElementsByTagName('body')[0].clientWidth; } return viewportwidth; } /* * * Get view port height. Helpful as resolution differs for different monitor. * */ function getMheight(){ var viewportheight; if (typeof window.innerWidth != 'undefined') { viewportheight = window.outerHeight; } else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) { viewportheight = document.documentElement.clientHeight; } else { viewportheight = document.getElementsByTagName('body')[0].clientHeight; } return viewportheight; } //var format = 'cup2z-TYGY'; function formatNumber(val, format){ //return formatTime(val); var Gsym=','; // Grouping Symbol var dec='.'; //Decimal symbol var precesionVal=0, prefixval="", suffixval=""; /* We will not use precesion, prefix,suffix for axis formatting */ if (format && format.currency == "e") { Gsym='.'; dec=','; } if(Math.abs(val)>=1000000000000){ val=val/1000000000000; suffixval='T'; precesionVal=2; } else if(Math.abs(val)>=1000000000){ val=val/1000000000; suffixval='B'; precesionVal=2; } else if(Math.abs(val)>=1000000){ val=val/1000000; suffixval='M'; precesionVal=1; } else if(Math.abs(val)>=1000){ val=val/1000; suffixval='K'; precesionVal=1; } else if(Math.abs(val)>=100){ val=val/1000; suffixval='K'; precesionVal=1; } return formatMoney(val, prefixval, suffixval, precesionVal, dec, Gsym); } function formatMoney(m,a,b,c, d, t){ var n = m, c = isNaN(c = Math.abs(c)) ? 2 : c, d = d == undefined ? "," : d, t = t == undefined ? "." : t, s = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0; return a+""+s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "")+b; } function formatTimeTicks(val){ if(val ==0) return 0; var sec_num = parseInt(val, 10); var days = Math.floor(sec_num / 86400); var hours = Math.floor((sec_num - (days*86400) ) / 3600); var minutes = Math.floor((sec_num - (days*86400) - (hours * 3600)) / 60); var seconds = sec_num - (days*86400) - (hours * 3600) - (minutes * 60); if(days >0) { days = days+ (days>1?" Days ":" Day "); } else{ days=""; } if (hours > 0) { hours = hours+(hours>1?" Hours ":" Hour "); } else { hours=""; } if (minutes > 0) { minutes = minutes+(minutes>1?" Minutes ":" Minute "); } else { minutes=""; } if (seconds > 0) { seconds = seconds+(seconds>1?" Seconds":" Second"); } else { seconds=""; } return days+''+hours+''+minutes+''+seconds; } function formatTime(val){ var sec_num = parseInt(val, 10); var days = Math.floor(sec_num / 86400); var hours = Math.floor((sec_num - (days*86400) ) / 3600); var minutes = Math.floor((sec_num - (days*86400) - (hours * 3600)) / 60); var seconds = sec_num - (days*86400) - (hours * 3600) - (minutes * 60); if(days >0) {days = days+ (days>1?" Days ":" Day ");} else{days="";} if (hours < 10) {hours = "0"+hours;} if (minutes < 10) {minutes = "0"+minutes;} if (seconds < 10) {seconds = "0"+seconds;} var time = days+""+hours+':'+minutes+':'+seconds; //var time = hours+' H, '+minutes+' M, '+seconds+' S'; return time; } function makeTimeMinMax(minMaxArr){ var min=minMaxArr[0]; var max=minMaxArr[1]; if(min > (86400*2)){ /* if more then 2 days */ tmp=Math.floor(min/86400); min=tmp*86400; } else if(min > (3600*3)){ /* if more then 3 hours */ tmp=Math.floor(min/3600); min=tmp*3600; } else if(min > 3600){ /* more then 1 hour */ tmp=Math.floor(max/60); min=tmp*60; } minMaxArr[0]=min; if(max > (86400*2)){ /* if more then 2 days */ tmp=Math.ceil(max/86400); max=tmp*86400; } else if(max > (3600*3)){ /* if more then 3 hours */ tmp=Math.ceil(max/3600); max=tmp*3600; } else if(max > 3600){ /* more then 1 hour */ tmp=Math.ceil(max/60); max=tmp*60; } minMaxArr[1]=max; return minMaxArr; } function getFromURL(reqStr){ if(document.URL.length >0 && document.URL.split(reqStr+'=').length >1) return(document.URL.split(reqStr+'=')[1].split('&')[0].replace('#','')); } function getFormat(formatter){ var format={ currency : 'u', prefix : '', suffix : '', prec : '', dec : '.', //Decimal symbol Gsym : ',' // Grouping Symbol }; if((typeof formatter === 'undefined') || (formatter.length<1)) return format; var cur = formatter.indexOf("c"); if(cur >=0) format.currency=formatter.substr(cur + 1, 1); var precesion = formatter.indexOf("p"); if(precesion >=0) format.prec=formatter.substr(precesion + 1, 1); var prefix = formatter.indexOf("P"); if(prefix>=0) format.prefix = formatter.substr(prefix + 1, 1); var suffix = formatter.indexOf("S"); if(suffix >= 0) format.suffix = formatter.substr(suffix + 1, 1); if (formatter.charAt(1) == "e") { format.Gsym='.'; format.dec=','; } return format; } function formatSmallScale(val, format){ return String(formatData(val, format, 1)).replace(" Days", "D").replace(" Day", "D").replace(" Hours", "H").replace(" Hour", "H").replace(" Minutes", "M").replace(" Minute", "M").replace(" Seconds", "S").replace(" Second", "S"); } function formatData(value, dataFormat, isAxis){ if(isAxis){ if(dataFormat && dataFormat.charAt(1) == 't') return formatTimeTicks(value); else return formatNumber(value); } else if(dataFormat && dataFormat.charAt(1) == 't'){ return formatTime(value); } else{ var format=getFormat(dataFormat); return formatMoney(value, format.prefix, format.suffix, format.prec,format.dec,format.Gsym); } } /* Replacement of d3.csv.parse(inData.join('\n')); Optimized to save time. */ function parse2DArray(data){ var header=new Array(), objArr=new Array(); for(var i=0; i<data.length; i++){ if (i) { var o = {}, j = -1, m = header.length; while (++j < m) o[header[j]] = data[i][j]; objArr.push(o); } else { header = data[i]; } } return objArr; } function prepareNshowChart(authToken, divId, gType, title, ReportObj ){ var metaDataCollection=createItemList(authToken); //var dispObj=new displayOptions(); var callback=callbackReportData; /*Should be a function name which you want to call after getting data */ ReportObj.setgtype(gType); ReportObj.settitle(title); /*if(!ReportObj.topn || ReportObj.topn<0) ReportObj.settopn(1000);*/ if(gType != 'M'){ for(var i=0; i<G_FilterList.filterList.length; i++){ ReportObj.filterList.filterList.push(G_FilterList.filterList[i]); } } ReportObj.setdimensionFilters(ReportObj.filterList.getFilterString("D")); ReportObj.setmeasureFilters(ReportObj.filterList.getFilterString("M")); var mapType="World"; if(ReportObj.dispObj.RD && ReportObj.dispObj.RD.General.mapType) mapType=ReportObj.dispObj.RD.General.mapType; var displayObj=new displayOptions(); displayObj.RDsetGeneral(); displayObj.RD.General.divId=divId; displayObj.RD.General.portlet=0; displayObj.RD.General.authToken=authToken; displayObj.RD.General.mapType=mapType; ReportObj.dispObj=displayObj; if(ReportObj.dimensions && ReportObj.dimensions.length>0){ if(gType != 'M'){ ReportObj.setsystitle(ReportObj.measures.join(',')+ ' by '+ ReportObj.dimensions.join(',')); /*Required for Table Chart */ ReportObj.setsubtitle(G_FilterList.getReadableFilterString('D') + G_FilterList.getReadableFilterString('M')); $(".portletTitle", $("div#"+divId).parent().parent()).html(G_FilterList.getReadableFilterString('D')); } createReport(authToken, false, callback, ReportObj); } else{ $("#"+divId).html("<center><b><br><br>Please click settings icon to add dimensions and measures.</b></center>"); } return ReportObj; } function getGtypeCombo(){ var gTypesFull=['Text','Pie','Line','Bar','Stack Bar','Combo', 'Column','Bullet','Gauge','PC', 'Tree','Map','Heat', 'Radar', 'Stock', 'SVG']; var gTypes=['T','P','L','B','S','C', 'N','Bullet','G','PC', 'Tree','M','Heat', 'Radar','Stock','SVG']; var gDisp =['Text','Pie','Line','Bar','Stack Bar','Bar+Line','Column','Bullet','Gauge','KPI','Tree','Map','Heat Chart','Radar', 'Stock', 'Custom']; var htmlStr='<select class=gtypeCombo>'; for(var i=0; i<gTypes.length; i++){ htmlStr+='<option value="'+gTypes[i]+'">'+gDisp[i]+'</option>'; } htmlStr+='</select>'; return htmlStr; } function getMapLocationCombo(){ var mLoc=["World","India-Telecom","India-States","usa","North America","South America","Africa","Asia","Southeast Asia","Australia","Europe","Malaysia","Singapore"]; var mLocFull=["World","India(Telecom)","India(States)","America","America(North)","America(South) ","Africa","Asia","Asia(Southeast) ","Australia","Europe","Malaysia","Singapore"]; var htmlStr='<select class=mapTypeCombo>'; for(var i=0; i<mLoc.length; i++){ htmlStr+='<option value="'+mLoc[i]+'">'+mLocFull[i]+'</option>'; } htmlStr+='</select>'; return htmlStr; } function getVDBdetailsFromDB(authToken, portlet, type){ var ReportObj = new Report(); initReportObj(ReportObj); ReportObj.gtype=gtype[portlet]; var report = getContentData(authToken, type, portlet); if(report.length>0) report=$.evalJSON(report); else return ReportObj; var metaDataCollection=createItemList(authToken); for(var i=0; i<report.dimensionIds.length; i++){ item=metaDataCollection.getItemById(report.dimensionIds[i]); ReportObj.addDimensionToReport(item); } for(var i=0; i<report.measureIds.length; i++){ item=metaDataCollection.getItemById(report.measureIds[i]); ReportObj.addMeasureToReport(item); } ReportObj.filterList.filterList=report.filterList; ReportObj.setgtype(report.gtype); ReportObj.setlayout(report.layout); ReportObj.settopn(report.topn); ReportObj.dispObj=new displayOptions(); ReportObj.dispObj.RDsetGeneral(); if(report.mapType) ReportObj.dispObj.RD.General.mapType=report.mapType; else ReportObj.dispObj.RD.General.mapType="World"; return ReportObj; } function freezeTextHeader(modContId){ var container=$("#"+modContId); var table=container.children(); if(table.attr("class") == "sorttable"){ $('th, td', $('thead tr', table)).each(function(i){ $(this).css('width',$(this).width()+'px'); }); $('td', $('tbody tr:first', table)).each(function(i){ $(this).css('width',$(this).width()+'px'); $(this).css('min-width',$(this).width()+'px'); }); $('td', $('tfoot tr:first', table)).each(function(i){ $(this).css('width',$(this).width()+'px'); }); container.prepend('<div><table border="0" cellspacing="1" cellpadding="3" class="tbl_border"><THEAD>'+table[0].tHead.innerHTML+'</THEAD></table></div>'); table[0].deleteTHead(); table.wrap('<div style="height:220px;overflow:auto;"></div>'); container.append('<div><table border="0" cellspacing="1" cellpadding="3" class="tbl_border"><TFOOT>'+table[0].tFoot.innerHTML+'</TFOOT></table></div>'); table[0].deleteTFoot(); } else{ if((container.children().length == 3) && (container.children().eq(1).children().attr("class") == "sorttable")){ table=container.children().eq(1).children(); table[0].tHead=container.children().eq(0).children()[0].tHead; table[0].tFoot=container.children().eq(2).children()[0].tFoot; container.children().eq(0).remove(); container.children().eq(1).remove(); /* child shifted, so 1 */ table.unwrap(); } } } function makeProperHeight(Height, divId){ if(Height === 'undefined' || String(Height).length<1 || parseFloat(Height)<50) Height=parseFloat($("div#"+divId).css('height')); return Height; } function makeProperWidth(Width, divId){ if(Width === 'undefined' || String(Width).length<1 || parseFloat(Width)<50) Width=parseFloat($("div#"+divId).css('width')); return Width; }