123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386 |
- var cf = (typeof getConfigFrame == "function" ? getConfigFrame() : this);
- var giRANGE_STRING = -1;
- var giRANGE_NUMERIC = 0;
- var giRANGE_DATE = 1;
- var giRANGE_TIME = 2;
- var giRANGE_DATETIME = 3;
- var giRANGE_INTERVAL = 4;
- var giRANGE_VALUES = 5;
- var gsPREVIEW = "pb-";
- var gsRANGEHEADER = "Range";
- var gsSELECTHEADER = "Selection";
- var gsSELECTLINK = "(Select a value)";
- var gsADDRANGELINK = "(Add a range)";
- var gsSTYLEHEADER = "Style";
- var gsPREVIEWTEXT = "AaBbCc";
- var gsSELECTCLASS = "sc-";
- var gsTHRESHOLD = "tb-";
- var gsHIGHESTVALUE = "Highest value";
- var gsLOWESTVALUE = "Highest value";
- var gsCSSCLASS_DEFAULT = 'cs-default';
- var gsCSSCLASS_CUSTOM = 'cs-custom';
- var gsCSS_DEFAULT = "(default)";
- var gsCSS_EXCELLENT = "Great";
- var gsCSS_GOOD = "Good";
- var gsCSS_AVERAGE = "Average";
- var gsCSS_BAD = "Bad";
- var gsCSS_POOR = "Poor";
- var gsCSS_CUSTOM = "(custom)";
- var gsDATAFORMAT_INTERVAL = "^0 days, ^1 hrs, ^2 mins";
- var gsMISSING_VALUES = "<missing values>";
- function CStyleRangeList(columnId, type, colType) {
- this.m_columnId = columnId;
- this.m_id = "csrl_" + getSafeIdentifier(columnId);
- this.m_ranges = null;
- this.setType(type);
- this.setColType(colType);
- this.m_defaultClass = "";
- this.m_defaultStyleInfo = "";
- this.m_ranges = new Array();
- };
- function CStyleRangeList_initStrings(sRange, sSelect, sSelectLink, sAddRangeLink, sStyle, sHigh, sLow, sPreview, sDefault, sExcellent, sGood, sAvg, sBad, sPoor, sCustom, sIntervalFormat, sMissingValues)
- {
- gsPREVIEWTEXT = sPreview;
- gsRANGEHEADER = sRange;
- gsSELECTHEADER = sSelect;
- gsSELECTLINK = sSelectLink;
- gsADDRANGELINK = sAddRangeLink;
- gsSTYLEHEADER = sStyle;
- gsHIGHESTVALUE = sHigh;
- gsLOWESTVALUE = sLow;
- gsCSS_DEFAULT = sDefault;
- gsCSS_EXCELLENT = sExcellent;
- gsCSS_GOOD = sGood;
- gsCSS_AVERAGE = sAvg;
- gsCSS_BAD = sBad;
- gsCSS_POOR = sPoor;
- gsCSS_CUSTOM = sCustom;
- gsDATAFORMAT_INTERVAL = sIntervalFormat;
- gsMISSING_VALUES = cf.htmlencode(sMissingValues);
- };
- function CStyleRangeList_addStyleRange(styleRange) {
- this.m_ranges[this.m_ranges.length] = styleRange;
- styleRange.m_parent = this;
- return styleRange;
- };
- function CStyleRangeList_addRange(from, to) {
-
- var r = new CStyleRange(from, to, true, true);
- r.setId(this.generateID());
- return ( this.addStyleRange(r) );
- };
- function CStyleRangeList_addSVList(svList) {
- var sv = new CStyleSV(svList);
- sv.setId(this.generateID());
- return ( this.addStyleRange(sv) );
- };
- function CStyleRangeList_addThreshold(threshold)
- {
- if ( this.m_type == giRANGE_VALUES )
- return null;
- if ( !this.m_ranges )
- this.m_ranges = new Array();
- if ( this.m_type == giRANGE_NUMERIC ) {
- threshold = parseFloat(threshold);
- if (isNaN(threshold)) {
- return;
- }
- }
- var rangeIndex = this.indexWith(threshold);
- var aNewRanges = new Array();
- if ( rangeIndex > -1 ) {
-
- var old_r = this.m_ranges[rangeIndex];
-
- if (old_r.getFrom() == threshold || old_r.getTo() == threshold) {
- return;
- }
- var new_r = old_r.clone();
- new_r.setId(this.generateID());
- new_r.setTo(threshold);
- new_r.setToInclusive(true);
- if ( this.rangeExists(new_r) ) {
-
- return;
- }
- old_r.setFrom(threshold);
- old_r.setFromInclusive(false);
- this.insertRangeAt(new_r,rangeIndex);
- aNewRanges[aNewRanges.length] = new_r;
- aNewRanges[aNewRanges.length] = old_r;
- }
- else {
- var r1 = new CStyleRange(null, threshold);
- r1.setId(this.generateID());
- r1.setClass(this.getClass());
- r1.setStyleInfo(this.getStyleInfo());
- aNewRanges[aNewRanges.length] = this.addStyleRange( r1 );
- var r2 = new CStyleRange(threshold, null);
- r2.setId(this.generateID());
- r2.setClass(this.getClass());
- r2.setStyleInfo(this.getStyleInfo());
- aNewRanges[aNewRanges.length] = this.addStyleRange( r2 );
- }
- return aNewRanges;
- };
- function CStyleRangeList_clone() {
- var clone = new CStyleRangeList();
- clone.m_columnId = this.columnId;
- clone.m_ranges = this.m_ranges.clone();
- clone.m_type = this.m_type;
- clone.m_colType = this.m_colType;
- if (clone.m_ranges) {
- for (var i = 0; i < clone.m_ranges.length; i++) {
- clone.m_ranges[i].m_parent = clone;
- }
- }
- return clone;
- };
- function CStyleRangeList_generateID()
- {
- var i = 0;
- while ( this.getRangeById("styleRange" + i) != null )
- i++;
- return ("styleRange" + i);
- };
- function CStyleRangeList_getClass() {
- if (this.m_defaultClass == null) {
- this.m_defaultClass = "";
- }
- return this.m_defaultClass;
- };
- function CStyleRangeList_getColType() {
- return this.m_colType;
- };
- function CStyleRangeList_getCommand() {
- var s = "OA:" + cf.escapeParam(this.m_columnId) + ",";
- var filterType = '';
- switch (this.getType()) {
- case giRANGE_NUMERIC:
- filterType = "numeric"; break;
- case giRANGE_STRING:
- filterType = "string"; break;
- case giRANGE_DATE:
- filterType = "date"; break;
- case giRANGE_DATETIME:
- filterType = "datetime"; break;
- case giRANGE_TIME:
- filterType = "time"; break;
- case giRANGE_INTERVAL:
- filterType = "interval"; break;
- case giRANGE_VALUES:
- filterType = "selectValue"; break;
- default:
- break;
- }
- var xml = '<CStyle type="' + filterType + '"';
- if (this.getColType()) {
- xml += ' colType="' + this.getColType() + '"';
- }
- xml += '>';
- var FEs = new Array();
- for (var i = 0; i < this.m_ranges.length; i++) {
- var v = this.m_ranges[i];
- var fe = null;
- if (v instanceof CStyleSV) {
- fe = new cf.CFilterExpression(v.getId(),v.m_selectValueList);
- }
- else if (v instanceof CStyleRange) {
- fe = new cf.CFilterExpression(v.getId());
- fe.setFilterType('range');
- var from = (v.getFrom() != null ? v.getFrom().toString() : '');
- var to = (v.getTo() != null ? v.getTo().toString() : '');
- var decimalSeparator = goDialogManager.getMiniQueryManager().getDecimalSeparator();
- if (filterType == "numeric") {
- from = from.replace(/\./gi, decimalSeparator);
- to = to.replace(/\./gi, decimalSeparator);
- }
- fe.setFrom(from,from,!v.getFromInclusive());
- fe.setTo(to,to,!v.getToInclusive());
- }
- if (fe !== null) {
- fe.setClassName(v.getClass());
- fe.setStyle(v.getStyleInfo());
- var t = cf.dlgGlobalGetParm('xxDataType');
- if (t == "level" || t == "hierarchy" || t == "member") {
- fe.setDataType('MUN');
- }
- else {
- fe.setDataType(t);
- }
- xml += fe.getXML();
- }
- }
- if (this.getStyleInfo()) {
-
- var fe = new cf.CFilterExpression();
- fe.setDefault(true);
- fe.setClassName(this.getClass());
- fe.setStyle(this.getStyleInfo());
- xml += fe.getXML();
- }
- xml += '</CStyle>';
- s += cf.escapeParam(xml);
- return s;
- };
- function CStyleRangeList_getId() {
- return this.m_id;
- };
- function CStyleRangeList_getRangeAt(index) {
- if (index < 0) {
- return null;
- }
- if (this.m_ranges != null && index < this.m_ranges.length) {
- return this.m_ranges[index];
- }
- return null;
- };
- function CStyleRangeList_getRangeById(id) {
- if (this.m_ranges) {
- for (var i = 0; i < this.m_ranges.length; i++) {
- if (this.m_ranges[i].getId() == id) {
- return this.m_ranges[i];
- }
- }
- }
- if (id == this.m_id) {
- return this;
- }
- return null;
- };
- function CStyleRangeList_getStyleInfo() {
- if (this.m_defaultStyleInfo == null) {
- this.m_defaultStyleInfo = "";
- }
- return this.m_defaultStyleInfo;
- };
- function CStyleRangeList_getType() {
- return this.m_type;
- };
- function CStyleRangeList_indexOf(value) {
- if (this.m_ranges) {
- for (var i = 0; i < this.m_ranges.length; i++) {
- if (this.m_ranges[i] == value || this.m_ranges[i].getId() == value) {
- return i;
- }
- }
- }
- return -1;
- };
- function CStyleRangeList_indexWith(value) {
- if (this.m_ranges) {
- for (var i = 0; i < this.m_ranges.length; i++) {
- if (this.m_ranges[i].contains(value)==0) {
- return i;
- }
- }
- }
- return -1;
- };
- function CStyleRangeList_insertRangeAt(range, index) {
- if (this.m_ranges) {
- var new_ranges = new Array();
- if (index < 0) {
- new_ranges[new_ranges.length] = range;
- }
- for (var i = 0; i < this.m_ranges.length; i++) {
- if (i == index) {
- new_ranges[new_ranges.length] = range;
- }
- new_ranges[new_ranges.length] = this.m_ranges[i];
- }
- if (index >= this.m_ranges.length || index == null)
- new_ranges[new_ranges.length] = range;
- this.m_ranges = new_ranges;
- }
- };
- function CStyleRangeList_moveRange(id, delta)
- {
- var r = this.getRangeById(id);
- if (r)
- {
- var rIndex = this.indexOf(r);
- var step = (delta < 0 ? -1 : 1);
- if (delta < 0 && (rIndex + delta) >= 0) {
- for (var i = rIndex; i > rIndex + delta; i--) {
- var swapObject = this.m_ranges[i];
- this.m_ranges[i] = this.m_ranges[i + step];
- this.m_ranges[i + step] = swapObject;
- }
- }
- else if (delta > 0 && (rIndex + delta) < this.m_ranges.length) {
- for (var i = rIndex; i < rIndex + delta; i++) {
- var swapObject = this.m_ranges[i];
- this.m_ranges[i] = this.m_ranges[i + step];
- this.m_ranges[i + step] = swapObject;
- }
- }
- }
- };
- function CStyleRangeList_rangeExists(new_r) {
- if (this.m_ranges) {
- for (var i = 0; i < this.m_ranges.length; i++) {
- var r = this.m_ranges[i];
- var n_from = new_r.getFrom();
- var n_to = new_r.getTo();
- var o_from = r.getFrom();
- var o_to = r.getTo();
- if (typeof n_from == "string") { n_from = n_from.toUpperCase(); }
- if (typeof n_to == "string") { n_to = n_to.toUpperCase(); }
- if (typeof o_from == "string") { o_from = o_from.toUpperCase(); }
- if (typeof o_to == "string") { o_to = o_to.toUpperCase(); }
- if (n_from == o_from && n_to == o_to && new_r.getFromInclusive() == r.getFromInclusive() && new_r.getToInclusive() == r.getToInclusive())
- return true;
- }
- }
- return false;
- };
- function CStyleRangeList_removeRange(r)
- {
- if ( !(r instanceof CStyleRange || r instanceof CStyleSV) ) {
- r = this.getRangeById(r);
- }
- if ( !(r instanceof CStyleRange || r instanceof CStyleSV) ) {
- return;
- }
- var retval = null;
- var newRanges = new Array();
- for (var i = 0; i < this.m_ranges.length; i++) {
- if (this.m_ranges[i].getId() == r.getId()) {
-
- retval = this.m_ranges[i];
- if (this.m_type != giRANGE_VALUES) {
-
- if ( (i+1) < this.m_ranges.length ) {
- this.m_ranges[i+1].setFrom( (newRanges.length > 0 ? newRanges[newRanges.length-1].getTo() : null) );
- this.m_ranges[i+1].setFromInclusive( !(newRanges.length > 0 ? newRanges[newRanges.length-1].getToInclusive() : true) );
- }
- else if ( newRanges.length > 0 ) {
- newRanges[newRanges.length-1].getTo() = null;
- }
- }
- }
- else {
- newRanges[newRanges.length] = this.m_ranges[i];
- }
- }
- this.m_ranges = newRanges;
- if (this.m_type != giRANGE_VALUES) {
-
- if (this.m_ranges && this.m_ranges.length <= 1 && this.m_ranges[0].getFrom() == null && this.m_ranges[0].getTo() == null) {
- this.setClass(this.m_ranges[0].getClass());
- this.setStyleInfo(this.m_ranges[0].getStyleInfo());
- this.m_ranges = new Array();
- }
- }
- return retval;
- };
- function CStyleRangeList_removeThreshold(threshold) {
- for (var i = 0; i < this.m_ranges.length; i++) {
- if ( this.m_ranges[i].getTo() == threshold ) {
- return this.removeRange(this.m_ranges[i]);
- }
- }
- return null;
- };
- function CStyleRangeList_render(container, clientWin)
- {
- if ( typeof container != "object" ) {
-
- }
-
- var hs =
- '<td height="15" width="1" nowrap="nowrap" style="padding: 2px;">' +
- '<table border="0" cellpadding="0" cellspacing="0" ><tr>' +
- '<td class="tableHeaderDivider" width="1"><img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/ps/images/space.gif" border="0" height="15" width="1"/></td>' +
- '</tr></table>' +
- '</td>';
-
- var out =
- '<table' + ( this.m_type == giRANGE_VALUES ? '' : ' height="100%"' ) + ' border="0" cellpadding="0" cellspacing="0">' +
- '<tr class="tableHeader">' +
- '<td width="1" nowrap="nowrap"><img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/ps/images/space.gif" border="0" height="1" width="21"/></td>' +
- hs +
- '<td class="tableTitle" height="10" '+( this.m_type == giRANGE_VALUES ? 'width="50%"' : 'width="105"' )+' valign="center" nowrap="nowrap" style="padding-left:2px;padding-top:2px;">' +
- ( this.m_type == giRANGE_VALUES ? gsSELECTHEADER : gsRANGEHEADER ) +
- '</td>' +
- '<td nowrap="nowrap" colspan="2"' + ( this.m_type == giRANGE_VALUES ? 'width="50%"' : ' width="100%"' ) + '><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>' +
- '<td width="1" nowrap="nowrap"><img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/ps/images/space.gif" border="0" height="1" width="10"/></td>' +
- hs +
- '<td class="tableTitle" width="100%" height="10" valign="center" nowrap="nowrap" style="padding-left:2px;padding-top:2px;">' +
- gsSTYLEHEADER +
- '</td>' +
- '</tr></table></td>' +
- '</tr>';
- var msgID_highest = "HIGHEST";
- var msgID_lowest = "LOWEST";
- if (this.m_type == giRANGE_DATE || this.m_type == giRANGE_DATETIME) {
- msgID_highest = "HIGHEST_DATE";
- msgID_lowest = "LOWEST_DATE";
- }
- else if (this.m_type == giRANGE_TIME) {
- msgID_highest = "HIGHEST_TIME";
- msgID_lowest = "LOWEST_TIME";
- }
- if (this.m_ranges.length > 0) {
- if (this.m_type == giRANGE_VALUES) {
- for (var i = 0; i < this.m_ranges.length; i++) {
- out += this.m_ranges[i].render(clientWin);
- }
- }
- else {
- out += splitRow(msgCndFrmt[msgID_highest]);
- for (var i = this.m_ranges.length - 1; i > 0; i--) {
- out += this.m_ranges[i].render(clientWin);
- out += splitRow("");
- }
- if (this.m_ranges.length > 0) {
- out += this.m_ranges[0].render(clientWin);
- }
- out += splitRow(msgCndFrmt[msgID_lowest]);
- }
- }
- if (this.m_ranges.length == 0 || this.m_type == giRANGE_VALUES) {
-
- if (this.m_type == giRANGE_VALUES) {
- out += '<tr>' +
- '<td colspan="2"><img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/common/images/spacer.gif" border="0" width="1" height="20" /></td>' +
- '<td colspan="' + (this.m_ranges.length > 0 ? '2' : '1') + '" class="tabletext">' +
- '<a href="javascript:void(0);" onmousedown="pickValues()">' + cf.htmlencode(gsSELECTLINK) + '</a> ' +
- msgCndFrmt["OR"] +
- ' <a href="javascript:void(0);" onmousedown="pickTextRange()">' + cf.htmlencode(gsADDRANGELINK) + '</a>' +
- (this.m_ranges.length > 0 ? '' : renderStyleControls(this)) +
- '</td></tr>';
- if (this.m_ranges.length > 0) {
- out += '<tr><td colspan="2"><img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/common/images/spacer.gif" border="0" width="1" height="1" /></td>' +
- '<td class="tabletext" nowrap="nowrap">' +
- msgCndFrmt["REMAINING_VALUES"] +
- '</td>'+
- renderStyleControls(this) +
- '</tr>';
- }
- }
- else {
- out += splitRow(msgCndFrmt[msgID_highest]) +
- '<tr height="100%"><td colspan="3"><img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/common/images/spacer.gif" border="0" width="131" height="1" /></td>' +
- '<td width="1">' +
- '<table border="0" cellpadding="0" cellspacing="0" height="100%" width="1">' +
- '<tr><td><img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() +'/qs/images/range_top.gif" border="0" height="3" width="23" /></td></tr>' +
- '<tr><td style="background:url(' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() +'/qs/images/range_resize.gif); background-repeat : repeat-y;"><img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/common/images/spacer.gif" border="0" height="3" width="23" /></td></tr>' +
- '<tr height="100%"><td height="100%" style="background:url(' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/qs/images/range_resize.gif); background-repeat : repeat-y;"><img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/qs/images/range_middle.gif" border="0" height="11" width="23" /></td></tr>' +
- '<tr><td style="background:url(' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/qs/images/range_resize.gif); background-repeat : repeat-y;"><img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/common/images/spacer.gif" border="0" height="3" width="23" /></td></tr>' +
- '<tr><td><img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/qs/images/range_bottom.gif" border="0" height="3" width="23" /></td></tr>' +
- '</table>' +
- '</td>' +
- renderStyleControls(this) + '</tr>';
- }
- if (this.m_type != giRANGE_VALUES) {
- out += splitRow(msgCndFrmt[msgID_lowest]);
- }
- }
- out += '</table>';
- container.innerHTML = out;
- };
- function renderStyleControls(obj)
- {
- var _id = "";
- var _class = "";
- var _style = "";
- if (obj != null) {
- _id = obj.getId();
- _class = obj.getClass();
- _style = obj.getStyleInfo();
- }
- var _bThresholdUI = false;
- var _t = obj.m_type;
- if (_t == null && obj.m_parent != null) {
- _t = obj.m_parent.m_type;
- }
- switch (_t) {
- case giRANGE_NUMERIC:
- case giRANGE_DATE:
- case giRANGE_TIME:
- case giRANGE_DATETIME:
- case giRANGE_INTERVAL:
- _bThresholdUI = true;
- }
- var s = '<td' + (_bThresholdUI ? ' width="100%"' : '') + ' valign="center" style="padding:3px;">' +
- '<table border="0" cellpadding="0" cellspacing="0"><tr>' +
- (_bThresholdUI ? '' : '<td><img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/common/images/spacer.gif" border="0" width="15" height="1" /></td>' ) +
- '<td><select id="' + gsSELECTCLASS + _id + '" onchange="changeCSSClass(\'' + _id + '\');">' +
- renderClassOption(gsCSSCLASS_DEFAULT, gsCSS_DEFAULT) +
- renderClassOption('csExcellent', gsCSS_EXCELLENT, _class, _style) +
- renderClassOption('csGood', gsCSS_GOOD, _class, _style) +
- renderClassOption('csAverage', gsCSS_AVERAGE, _class, _style) +
- renderClassOption('csBad', gsCSS_BAD, _class, _style) +
- renderClassOption('csPoor', gsCSS_POOR, _class, _style) +
- renderClassOption(gsCSSCLASS_CUSTOM, gsCSS_CUSTOM, _class, '') +
- '</select>' +
- '</td><td>' +
- '<img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/common/images/spacer.gif" border="0" width="10" height="1" />' +
- '</td><td>' +
- renderPreviewBox(obj) +
- '</td><td style="padding:0px 2px 0px 5px;">' +
- '<img class="icon" title="' + cf.htmlencode(msgCndFrmt["EDIT_STYLE_TIP"]) + '" src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/ps/portal/images/action_edit.gif" border="0" onmousedown="pickStyles(\'' + _id + '\');"/>' +
- '</td></tr></table>' +
- '</td>';
- return s;
- };
- function renderClassOption(name, text, css_class, css_style, bSelected)
- {
- var buf = '<option value="' + name + '"';
- if (css_class == name || bSelected) {
- buf += ' selected="true"';
- }
- buf += '>' + cf.htmlencode(text) + '</option>';
- return buf;
- };
- function renderPreviewBox(obj)
- {
- var _id = "";
- var _class = "";
- var _style = "";
- if (obj != null) {
- _id = obj.getId();
- _class = obj.getClass();
- _style = obj.getStyleInfo();
- }
- var s = '<div class="previewBox" style="line-height:20px;height:20px;width:60px;overflow:hidden;">' +
- '<div id="' + gsPREVIEW + _id + '" class="' + _class + '" style="' + _style + '">' +
- gsPREVIEWTEXT +
- '</div>' +
- '</div>';
- return s;
- };
- function renderThresholdControl(obj, bUpperBound, clientWin, _value, _formattedValue)
- {
- var objId = obj.getId();
- if (!bUpperBound) {
- var idx = getCSR().indexOf(obj);
- objId = getCSR().getRangeAt(idx-1).getId();
- }
- var s = '<tr><td style="padding:0px 5px;">' +
- '<img class="icon" title="' + cf.htmlencode(msgCndFrmt["DELETE_TIP"]) + '" src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/qs/images/toolbar/action_delete.gif" height="16" width="16" border="0" onclick="delTS(\'' + objId + '\');"/>' +
- '</td><td width="100%">';
- if (obj.m_parent.m_type == giRANGE_DATE ||
- obj.m_parent.m_type == giRANGE_TIME ||
- obj.m_parent.m_type == giRANGE_DATETIME ||
- obj.m_parent.m_type == giRANGE_INTERVAL)
- {
- s += '<table cellpadding="0" cellspacing="0" width="100%" border="0"><tr><td width="100%" style="padding-right:5px;text-align:right;" class="tabletext" nowrap="nowrap">';
- s += '<a href="javascript:void(0);" onmousedown="pickValues(\''+objId+'\');">' + _formattedValue + '</a>';
- s += '</td><td valign="bottom">';
- s += renderMoveTSIcon(obj, bUpperBound, true);
- s += '</td></tr></table>';
- }
- else {
- if (clientWin != null && typeof clientWin.sFormatNumber == 'function') {
- _value = clientWin.sFormatNumber(_value, false, true);
- }
- s += '<table cellpadding="0" cellspacing="0" border="0" height="100%">';
- s += '<tr><td><input id="' + gsTHRESHOLD + objId + '" type="text" style="text-align:right;width:100px;" value="' + _value + '" onchange="updTS(\'' + objId + '\');" onkeyup="if (event && event.keyCode==13){updTS(\'' + objId + '\');}">';
- s += '</td><td valign="' + (bUpperBound?'top':'bottom') + '">' + renderMoveTSIcon(obj, bUpperBound) + '</td></tr>';
- s += '</table>';
- }
- s += '</td></tr>';
- return s;
- };
- function renderMoveTSIcon(obj, bUp, bBorderLeft)
- {
- bUp = !(bUp == false);
- var icon = '' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/qs/images/style/rangestyle_' + (bUp ? 'up_' : 'down_');
- var s = '<img border="0" class="icon" src="' + icon + 'normal.gif" onclick="' +
- (bUp ? 'moveTSUp' : 'moveTSDown') + '(\'' + obj.getId() + '\');" onmouseover="this.src=\'' +
- icon + 'rollover.gif\';" onmouseout="this.src=\'' +
- icon + 'normal.gif\';"' + (document.all?' style="margin:1px 0px;"' : '') +
- 'title="' + msgCndFrmt[(bUp ? 'THRESHOLD_UP_TIP' : 'THRESHOLD_DOWN_TIP')] + '">';
- return s;
- };
- function splitRow(txt)
- {
- return '<tr height="1">' +
- '<td colspan="4" style="text-align:right;">' +
- '<table border="0" height="100%" cellpadding="0" cellspacing="0"><tr>' +
- '<td height="1" width="100%" style="text-align:right;" class="text" nowrap="nowrap">' +
- txt +
- '</td>' +
- '<td height="1" ><img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/qs/images/range_tic' +
- (txt ? '' : '_mid') + '.gif" height="' + (txt ? 11 : 6) + '" width="23" border="0"/></td>' +
- '</tr></table>' +
- '</td>' +
- '<td><img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/common/images/spacer.gif" border="0" width="1" height="1"/></td>' +
- '</tr>';
- };
- function CStyleRangeList_setClass(c) {
- this.m_defaultClass = (c ? c : gsCSSCLASS_DEFAULT);
- };
- function CStyleRangeList_setColType(type) {
- if (type && typeof type == "string") {
- this.m_colType = type;
- }
- else {
- this.m_colType = "";
- }
- };
- function CStyleRangeList_setId(id) {
- this.m_id = getSafeIdentifier(id);
- };
- function CStyleRangeList_setStyleInfo(s) {
- this.m_defaultStyleInfo = s;
- };
- function CStyleRangeList_setType(type) {
- switch (type) {
- case "numeric":
- type = giRANGE_NUMERIC; break;
- case "string":
- type = giRANGE_STRING; break;
- case "date":
- type = giRANGE_DATE; break;
- case "datetime":
- type = giRANGE_DATETIME; break;
- case "time":
- type = giRANGE_TIME; break;
- case "interval":
- type = giRANGE_INTERVAL; break;
- case "selectValue":
- type = giRANGE_VALUES; break;
- default:
- break;
- }
-
- if ( type == giRANGE_NUMERIC ||
- type == giRANGE_DATE ||
- type == giRANGE_DATETIME ||
- type == giRANGE_TIME ||
- type == giRANGE_INTERVAL ||
- type == giRANGE_VALUES)
- {
- this.m_type = type;
- }
- else
- {
- this.m_type = giRANGE_STRING;
- }
- };
- function CStyleRangeList_updateRangeStyle(id, className, styleInfo) {
- var r = this.getRangeById(id);
- if ( r instanceof CStyleRange ) {
- r.m_className = className;
- r.m_styleInfo = styleInfo;
- }
- };
- function CStyleRangeList_updateSVList(id, list) {
- var sv = this.getRangeById(id);
- if ( sv instanceof CStyleSV ) {
- sv.update(list);
- }
- };
- function CStyleRangeList_updateThreshold(id, threshold) {
-
- var aCSSStyles = new Array();
- for (var i = 0; i < this.m_ranges.length; i++) {
- var r = this.m_ranges[i];
- aCSSStyles[aCSSStyles.length] = [r.getClass(), r.getStyleInfo(), r.getFromInclusive(), r.getToInclusive()];
- }
-
- var aNewRanges = this.addThreshold(threshold);
- if ( aNewRanges && aNewRanges[0] instanceof CStyleRange ) {
- var r = this.removeRange(id);
- }
-
- for (var i = 0; i < this.m_ranges.length; i++) {
- var r = this.m_ranges[i];
- r.setClass(aCSSStyles[i][0]);
- r.setStyleInfo(aCSSStyles[i][1]);
- r.setFromInclusive(aCSSStyles[i][2]);
- r.setToInclusive(aCSSStyles[i][3]);
- }
- };
- CStyleRangeList.prototype.addStyleRange = CStyleRangeList_addStyleRange;
- CStyleRangeList.prototype.addRange = CStyleRangeList_addRange;
- CStyleRangeList.prototype.addSVList = CStyleRangeList_addSVList;
- CStyleRangeList.prototype.addThreshold = CStyleRangeList_addThreshold;
- CStyleRangeList.prototype.clone = CStyleRangeList_clone;
- CStyleRangeList.prototype.generateID = CStyleRangeList_generateID;
- CStyleRangeList.prototype.getClass = CStyleRangeList_getClass;
- CStyleRangeList.prototype.getColType = CStyleRangeList_getColType;
- CStyleRangeList.prototype.getCommand = CStyleRangeList_getCommand;
- CStyleRangeList.prototype.getId = CStyleRangeList_getId;
- CStyleRangeList.prototype.getRangeAt = CStyleRangeList_getRangeAt;
- CStyleRangeList.prototype.getRangeById = CStyleRangeList_getRangeById;
- CStyleRangeList.prototype.getStyleInfo = CStyleRangeList_getStyleInfo;
- CStyleRangeList.prototype.getType = CStyleRangeList_getType;
- CStyleRangeList.prototype.indexOf = CStyleRangeList_indexOf;
- CStyleRangeList.prototype.indexWith = CStyleRangeList_indexWith;
- CStyleRangeList.prototype.initStrings = CStyleRangeList_initStrings;
- CStyleRangeList.prototype.insertRangeAt = CStyleRangeList_insertRangeAt;
- CStyleRangeList.prototype.moveRange = CStyleRangeList_moveRange;
- CStyleRangeList.prototype.rangeExists = CStyleRangeList_rangeExists;
- CStyleRangeList.prototype.removeRange = CStyleRangeList_removeRange;
- CStyleRangeList.prototype.removeThreshold = CStyleRangeList_removeThreshold;
- CStyleRangeList.prototype.render = CStyleRangeList_render;
- CStyleRangeList.prototype.setClass = CStyleRangeList_setClass;
- CStyleRangeList.prototype.setColType = CStyleRangeList_setColType;
- CStyleRangeList.prototype.setId = CStyleRangeList_setId;
- CStyleRangeList.prototype.setStyleInfo = CStyleRangeList_setStyleInfo;
- CStyleRangeList.prototype.setType = CStyleRangeList_setType;
- CStyleRangeList.prototype.updateRangeStyle = CStyleRangeList_updateRangeStyle;
- CStyleRangeList.prototype.updateSVList = CStyleRangeList_updateSVList;
- CStyleRangeList.prototype.updateThreshold = CStyleRangeList_updateThreshold;
- function CStyleRange(fromValue, toValue, fromInclusive, toInclusive, className, styleInfo) {
- this.m_id = generateGUID();
- this.m_className = (className != null ? className : "");
- this.m_fromValue = null;
- this.m_toValue = null;
- this.m_parent = null;
- this.m_styleInfo = (styleInfo != null ? styleInfo : "");
- this.setFrom(fromValue);
- this.setFromInclusive(fromInclusive != null ? fromInclusive : false);
- this.setTo(toValue);
- this.setToInclusive(toInclusive != null ? toInclusive : true);
- };
- function CStyleRange_clone() {
- var clone = new CStyleRange();
- clone.m_id = this.m_id;
- clone.m_className = this.m_className;
- clone.m_fromInclusive = this.m_fromInclusive;
- clone.m_fromValue = this.m_fromValue;
- clone.m_parent = this.m_parent;
- clone.m_styleInfo = this.m_styleInfo;
- clone.m_toInclusive = this.m_toInclusive;
- clone.m_toValue = this.m_toValue;
- return clone;
- };
- function CStyleRange_contains(value) {
- var from = this.getFrom();
- var to = this.getTo();
- var v = value;
-
- from = getDaysFromInterval(from);
- to = getDaysFromInterval(to);
- v = getDaysFromInterval(v);
- if (typeof from == "string") { from = from.toUpperCase(); }
- else if (typeof from == "number") { from = parseFloat(from); }
- if (typeof to == "string") { to = to.toUpperCase(); }
- else if (typeof to == "number") {to = parseFloat(to);}
- if (typeof v == "string") { v = v.toUpperCase(); }
- else if (typeof v == "number") {v = parseFloat(v);}
- if ( (from == null || v > from) && (to == null || v < to))
- return 0;
- else if (this.getFromInclusive() && v == from)
- return 0;
- else if (this.getToInclusive() && v == to)
- return 0;
- else if (v <= from)
- return -1;
- else if (v >= to)
- return 1;
- return null;
- };
- function CStyleRange_getCommand() {
- var decimalSeparator = goDialogManager.getMiniQueryManager().getDecimalSeparator();
- var from = (this.getFrom() != null? this.getFrom().toString() : '');
- var to = (this.getTo() != null ? this.getTo().toString() : '');
- from = from.replace(/\./gi, decimalSeparator);
- to = to.replace(/\./gi, decimalSeparator);
- var a = [
- "range",
- (this.getClass() && this.getClass() != gsCSSCLASS_DEFAULT ? cf.escapeParam(this.getClass()) : "\\"),
- (this.getStyleInfo() ? cf.escapeParam(this.getStyleInfo()) : "\\"),
- (from != null ? cf.escapeParam(from) : "\\"),
- cf.escapeParam(this.getFromInclusive()),
- (to != null ? cf.escapeParam(to) : "\\"),
- cf.escapeParam(this.getToInclusive())
- ];
- return a.join();
- };
- function CStyleRange_getClass() {
- if (this.m_className == null) {
- this.m_className = "";
- }
- return this.m_className;
- };
- function CStyleRange_getFrom() {
- return this.m_fromValue;
- };
- function CStyleRange_getFromInclusive() {
- return this.m_fromInclusive;
- };
- function CStyleRange_getId() {
- return this.m_id;
- };
- function CStyleRange_getTo() {
- return this.m_toValue;
- };
- function CStyleRange_getToInclusive() {
- return this.m_toInclusive;
- };
- function CStyleRange_getStyleInfo() {
- if (this.m_styleInfo == null) {
- this.m_styleInfo = "";
- }
- return this.m_styleInfo;
- };
- function CStyleRange_getIndex() {
- if (this.m_parent instanceof CStyleRangeList && this.m_parent.m_ranges) {
- for (var i = 0; i < this.m_parent.m_ranges.length; i++) {
- if (this.m_parent.m_ranges[i].getId() == this.getId()) {
- return i;
- }
- }
- }
- return -1;
- };
- function CStyleRange_render(clientWin)
- {
- var out = '<tr>';
- var _from = this.getFrom();
- var _to = this.getTo();
- var _sFrom = (_from == null ? '' : _from);
- var _sTo = (_to == null ? '' : _to);
- if (this.m_parent.m_type == giRANGE_DATE) {
- if (_from != null) { _sFrom = getFormatDate(dParseDate(_from, 'YMD'), 0, g_dateOrder); }
- if (_to != null) { _sTo = getFormatDate(dParseDate(_to, 'YMD'), 0, g_dateOrder); }
- }
- else if (this.m_parent.m_type == giRANGE_TIME) {
- if (_from != null) { _sFrom = getFormatTime(dParseTime(_from), 2); }
- if (_to != null) { _sTo = getFormatTime(dParseTime(_to), 2); }
- }
- else if (this.m_parent.m_type == giRANGE_DATETIME) {
- if (_from != null) {
- _from.match(/(\d\d\d\d-\d\d-\d\d)\s*(.+)*/gi);
- var sDate = RegExp.$1; var sTime = RegExp.$2;
- _sFrom = getFormatDate(dParseDate(sDate, 'YMD'), 0, g_dateOrder) + (sTime ? " " + getFormatTime(dParseTime(sTime), 2) : "" );
- }
- if (_to != null) {
- _to.match(/(\d\d\d\d-\d\d-\d\d)\s*(.+)*/gi);
- var sDate = RegExp.$1; var sTime = RegExp.$2;
- _sTo = getFormatDate(dParseDate(sDate, 'YMD'), 0, g_dateOrder) + (sTime ? " " + getFormatTime(dParseTime(sTime), 2) : "" );
- }
- }
- else if (this.m_parent.m_type == giRANGE_INTERVAL) {
- if (_from != null) {
- _from.match(/(-?\d+) (\d\d):(\d\d)/gi);
- var sDays = parseInt(RegExp.$1, 10); var sHrs = parseInt(RegExp.$2, 10); var sMin = parseInt(RegExp.$3, 10);
- _sFrom = gsDATAFORMAT_INTERVAL.replace(/\^0/gi, sDays).replace(/\^1/gi, sHrs).replace(/\^2/gi, sMin);
- }
- if (_to != null) {
- _to.match(/(-?\d+) (\d\d):(\d\d)/gi);
- var sDays = parseInt(RegExp.$1, 10); var sHrs = parseInt(RegExp.$2, 10); var sMin = parseInt(RegExp.$3, 10);
- _sTo = gsDATAFORMAT_INTERVAL.replace(/\^0/gi, sDays).replace(/\^1/gi, sHrs).replace(/\^2/gi, sMin);
- }
- }
- else if (this.m_parent.m_type == giRANGE_NUMERIC)
- {
- if (clientWin != null && typeof clientWin.sFormatNumber == 'function') {
- if (_from != null) {
- _sFrom = clientWin.sFormatNumber(_from, false, true);
- }
- if (_to != null) {
- _sTo = clientWin.sFormatNumber(_to, false, true);
- }
- }
- }
- if (this.m_parent != null && this.m_parent.m_type == giRANGE_VALUES) {
- var out = '<tr id="csrow-' + this.getId() + '">' +
- '<td colspan="2"><img class="icon" title="' + cf.htmlencode(msgCndFrmt["SELECT_LINE_TIP"]) + '" src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/qs/images/filter/row_selector.gif" height="16" width="16" border="0" onclick="CS_SelectRow(event, \''+this.getId()+'\')"/></td>' +
- '<td class="tabletext"><a href="javascript:void(0);" onmousedown="pickTextRange(\''+this.getId()+'\')">';
- if (_from != null && _from !== "" && _to != null && _to !== "") {
- out += msgCndFrmt["RANGE_LINK"].replace(/\^0/gi, _sFrom).replace(/\^1/gi, _sTo);
- }
- else if (_from != null && _from !== "") {
- out += msgCndFrmt["RANGE_LINK_FROM"].replace(/\^0/gi, _sFrom);
- }
- else if (_to != null && _to !== "") {
- out += msgCndFrmt["RANGE_LINK_TO"].replace(/\^0/gi, _sTo);
- }
- out += '</a></td>';
- }
- else {
- out += '<td colspan="3"><table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%" >';
- if (_to != null && this.getToInclusive()) {
- out += renderThresholdControl(this, true, clientWin, _to, _sTo);
- }
- out += '<tr><td height="100%"><img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/common/images/spacer.gif" border="0" width="26" height="1"/></td><td><img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/common/images/spacer.gif" border="0" width="1" height="1"/></td></tr>';
- if (_from != null && this.getFromInclusive()) {
- out += renderThresholdControl(this, false, clientWin, _from, _sFrom);
- }
- out += '</table></td>';
- var rangeTip = "RANGE";
- if (_to != null) {
- rangeTip += '_LT';
- if (this.getToInclusive()) {
- rangeTip += '_EQ';
- }
- }
- if (_from != null) {
- rangeTip += '_GT';
- if (this.getFromInclusive()) {
- rangeTip += '_EQ';
- }
- }
- switch (this.m_parent.m_type) {
- case giRANGE_DATE:
- rangeTip += '_DATE'; break;
- case giRANGE_DATETIME:
- rangeTip += '_DATETIME'; break;
- case giRANGE_TIME:
- rangeTip += '_TIME'; break;
- }
- rangeTip = msgCndFrmt[(rangeTip + '_TIP')];
- if (typeof rangeTip == "string") {
- if (_to != null && _from != null) {
- rangeTip = rangeTip.replace(/\^0/gi, _sFrom).replace(/\^1/gi, _sTo);
- }
- else if (_from != null) {
- rangeTip = rangeTip.replace(/\^0/gi, _sFrom);
- }
- else if (_to != null) {
- rangeTip = rangeTip.replace(/\^0/gi, _sTo);
- }
- }
- else {
- rangeTip = "";
- }
- out +=
- '<td title="' + rangeTip + '" style="text-align:right;">' +
- '<table height="100%" border="0" cellpadding="0" cellspacing="0">' +
- '<tr><td><img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/qs/images/range_top.gif" border="0" height="3" width="23"/></td></tr>' +
- '<tr><td style="background:url(' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/qs/images/range_resize.gif); background-repeat : repeat-y;"><img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/common/images/spacer.gif" border="0" height="3" width="23"/></td></tr>' +
- '<tr height="100%"><td height="100%" style="background:url(' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/qs/images/range_resize.gif); background-repeat : repeat-y;"><img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/qs/images/range_middle.gif" border="0" height="11" width="23"/></td></tr>' +
- '<tr><td style="background:url(' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/qs/images/range_resize.gif); background-repeat : repeat-y;"><img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/common/images/spacer.gif" border="0" height="3" width="23"/></td></tr>' +
- '<tr><td><img src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/qs/images/range_bottom.gif" border="0" height="3" width="23"/></td></tr>' +
- '</table>' +
- '</td>';
- }
- out += renderStyleControls(this) + '</tr>';
- return out;
- };
- function CStyleRange_setClass(c) {
- this.m_className = (c ? c : gsCSSCLASS_DEFAULT);
- };
- function CStyleRange_setFrom(v) {
- this.m_fromValue = v;
- };
- function CStyleRange_setFromInclusive(v) {
- this.m_fromInclusive = (v == true || v == 'true');
- };
- function CStyleRange_setId(id) {
- this.m_id = getSafeIdentifier(id);
- };
- function CStyleRange_setTo(v) {
- this.m_toValue = v;
- };
- function CStyleRange_setToInclusive(v) {
- this.m_toInclusive = (v == true || v == 'true');
- };
- function CStyleRange_setStyleInfo(s) {
- this.m_styleInfo = s;
- };
- function CStyleRange_toString() {
- var s = (this.getFromInclusive() ? '[' : ']') +
- this.getFrom() +
- ', ' +
- this.getTo() +
- (this.getToInclusive() ? ']' : '[');
- return s;
- };
- function CStyleRange_update() {
- };
- CStyleRange.prototype.clone = CStyleRange_clone;
- CStyleRange.prototype.contains = CStyleRange_contains;
- CStyleRange.prototype.getCommand = CStyleRange_getCommand;
- CStyleRange.prototype.getClass = CStyleRange_getClass;
- CStyleRange.prototype.getFrom = CStyleRange_getFrom;
- CStyleRange.prototype.getFromInclusive = CStyleRange_getFromInclusive;
- CStyleRange.prototype.getId = CStyleRange_getId;
- CStyleRange.prototype.getTo = CStyleRange_getTo;
- CStyleRange.prototype.getToInclusive = CStyleRange_getToInclusive;
- CStyleRange.prototype.getStyleInfo = CStyleRange_getStyleInfo;
- CStyleRange.prototype.getIndex = CStyleRange_getIndex;
- CStyleRange.prototype.render = CStyleRange_render;
- CStyleRange.prototype.setClass = CStyleRange_setClass;
- CStyleRange.prototype.setFrom = CStyleRange_setFrom;
- CStyleRange.prototype.setFromInclusive = CStyleRange_setFromInclusive;
- CStyleRange.prototype.setId = CStyleRange_setId;
- CStyleRange.prototype.setTo = CStyleRange_setTo;
- CStyleRange.prototype.setToInclusive = CStyleRange_setToInclusive;
- CStyleRange.prototype.setStyleInfo = CStyleRange_setStyleInfo;
- CStyleRange.prototype.toString = CStyleRange_toString;
- CStyleRange.prototype.update = CStyleRange_update;
- function CStyleSV(svList) {
- if (svList != null && svList.length && !(svList[0] instanceof cf.CFilterValue)) {
- for (var i = 0; i < svList.length; i++) {
-
- if (typeof svList[i] == "object" && svList[i].length >= 2) {
- svList[i] = new cf.CFilterValue(svList[i][0], svList[i][1]);
- }
- else {
- svList[i] = new cf.CFilterValue(svList[i]);
- }
- }
- }
- else if (svList != null && svList.length && !(svList[0] instanceof cf.CFilterValue)) {
- for (var i = 0; i < svList.length; i++) {
-
- if (typeof svList[i] == "object" && svList[i].length >= 2) {
- svList[i] = new cf.CFilterValue(svList[i][0], svList[i][1]);
- }
- else {
- svList[i] = new cf.CFilterValue(svList[i]);
- }
- }
- }
- this.m_id = "";
- this.m_className = "";
- this.m_selectValueList = (svList != null ? svList : new Array());
- this.m_parent = null;
- this.m_styleInfo = "";
- this.m_missingValues = false;
- };
- function CStyleSV_clone() {
- var clone = new CStyleSV();
- clone.m_id = this.m_id;
- clone.m_className = this.m_className;
- clone.m_selectValueList = this.m_selectValueList;
- clone.m_parent = this.m_parent;
- clone.m_styleInfo = this.m_styleInfo;
- return clone;
- };
- function CStyleSV_getClass() {
- if (this.m_className == null) {
- this.m_className = "";
- }
- return this.m_className;
- };
- function CStyleSV_getCommand() {
- var a = [
- "selectValue",
- (this.getClass() && this.getClass() != gsCSSCLASS_DEFAULT ? cf.escapeParam(this.getClass()) : "\\"),
- (this.getStyleInfo() ? cf.escapeParam(this.getStyleInfo()) : "\\") ];
- if (this.m_selectValueList != null) {
- a[a.length] = this.m_selectValueList.length + ( this.getMissingValues() ? 1 : 0);
- for (var i = 0; i < this.m_selectValueList.length; i++) {
- a[a.length] = (this.m_selectValueList[i].getUse() ? cf.escapeParam(this.m_selectValueList[i].getUse()) : "\\");
- a[a.length] = (this.m_selectValueList[i].getDisplay() ? cf.escapeParam(this.m_selectValueList[i].getDisplay()) : "\\");
- }
- if (this.getMissingValues()) {
- a[a.length] = "\\";
- a[a.length] = "\\";
- }
- }
- return a.join();
- };
- function CStyleSV_getId() {
- return this.m_id;
- };
- function CStyleSV_getValues() {
- return this.m_selectValueList;
- };
- function CStyleSV_getMissingValues() {
- return this.m_missingValues;
- };
- function CStyleSV_getStyleInfo() {
- if (this.m_styleInfo == null) {
- this.m_styleInfo = "";
- }
- return this.m_styleInfo;
- };
- function CStyleSV_render(clientWin) {
- var out = '<tr id="csrow-'+this.getId()+'">' +
- '<td colspan="2"><img class="icon" title="' + cf.htmlencode(msgCndFrmt["SELECT_LINE_TIP"]) + '" src="' + goDialogManager.getReportFrame().oCVQS.getWebContentRoot() + '/qs/images/filter/row_selector.gif" height="16" width="16" border="0" onclick="CS_SelectRow(event, \''+this.getId()+'\')"/></td>' +
- '<td class="tabletext">';
- var sValues = "";
- if (this.m_selectValueList != null && this.m_selectValueList.length > 0) {
- var sConcatArray = msgCndFrmt["ARRAY_VALUES"];
- sValues = ( typeof this.m_selectValueList[0].getDisplay == "function" ?
- this.m_selectValueList[0].getDisplay() :
- this.m_selectValueList[0] );
- for (var i = 1; i < this.m_selectValueList.length; i++) {
- sValues = sConcatArray
- .replace(/\^0/gi, sValues)
- .replace(/\^1/gi, ( typeof this.m_selectValueList[i].getDisplay == "function" ?
- this.m_selectValueList[i].getDisplay() :
- this.m_selectValueList[i] ) );
- }
- }
- if (this.getMissingValues()) {
- if (sValues) {
- sValues = sConcatArray.replace(/\^0/gi, sValues).replace(/\^1/gi, gsMISSING_VALUES);
- }
- else {
- sValues = gsMISSING_VALUES;
- }
- }
- var maxStringLength = 1250;
- out += '<a href="javascript:void(0);" onmousedown="pickValues(\''+this.getId()+'\')"' +
- ( sValues.length <= 100 ? '' : ' title="' + cf.truncate_string.replace(/\^0/gi, (sValues.replace(/"/gi, '"')).substring(0,maxStringLength)) + '"' ) +
- '>' +
- ( sValues.length <= 100 ? sValues : getConfigFrame().truncate_string.replace(/\^0/gi, sValues.substring(0,100)) ) +
- '</a></td>' +
- renderStyleControls(this) +
- '</tr>';
- return out;
- };
- function CStyleSV_setClass(c) {
- this.m_className = (c ? c : gsCSSCLASS_DEFAULT);
- };
- function CStyleSV_setId(id) {
- this.m_id = getSafeIdentifier(id);
- };
- function CStyleSV_setMissingValues(b) {
- this.m_missingValues = (b == true || b == "true" || b == "include" ? true : false);
- };
- function CStyleSV_setStyleInfo(str) {
- this.m_styleInfo = str;
- };
- function CStyleSV_update(svList) {
- if (svList != null && svList.length && !(svList[0] instanceof cf.CFilterValue)) {
- for (var i = 0; i < svList.length; i++) {
-
- if (typeof svList[i] == "object" && svList[i].length >= 2) {
- svList[i] = new cf.CFilterValue(svList[i][0], svList[i][1]);
- }
- else {
- svList[i] = new cf.CFilterValue(svList[i]);
- }
- }
- }
- this.m_selectValueList = svList;
- };
- CStyleSV.prototype.clone = CStyleSV_clone;
- CStyleSV.prototype.getClass = CStyleSV_getClass;
- CStyleSV.prototype.getCommand = CStyleSV_getCommand;
- CStyleSV.prototype.getMissingValues = CStyleSV_getMissingValues;
- CStyleSV.prototype.getStyleInfo = CStyleSV_getStyleInfo;
- CStyleSV.prototype.getId = CStyleSV_getId;
- CStyleSV.prototype.getValues = CStyleSV_getValues;
- CStyleSV.prototype.render = CStyleSV_render;
- CStyleSV.prototype.setClass = CStyleSV_setClass;
- CStyleSV.prototype.setId = CStyleSV_setId;
- CStyleSV.prototype.setMissingValues = CStyleSV_setMissingValues;
- CStyleSV.prototype.setStyleInfo = CStyleSV_setStyleInfo;
- CStyleSV.prototype.update = CStyleSV_update;
- function generateGUID()
- {
- var prefix = "guid-";
- var i = 0;
- while (document.getElementById(prefix + i))
- { i++; }
- return prefix + i;
- };
- function getDaysFromInterval(value) {
- var str = (value != null ? value.toString() : '');
- if ( str != null && str.match(/^\s*(-*\d+) (\d+:\d+:\d+\.\d+)/) ) {
- var d = RegExp.$1;
- var t = RegExp.$2;
- d = parseInt(d,10);
- t = (d < 0 ? -1 : 1) * getDaysFromTime(t);
- return (d + t);
- }
- return value;
- };
- function getDaysFromTime(str) {
- if (str.match(/(\d+):(\d+):(\d+)\.(\d+)/)) {
- var h = parseInt(RegExp.$1, 10);
- var m = parseInt(RegExp.$2, 10);
- var s = parseInt(RegExp.$3, 10);
- var ms = parseInt(RegExp.$4, 10);
- return ( ((h*3600000) + (m*60000) + (s*1000) + ms) / 86400000);
- }
- return null;
- };
- function getSafeIdentifier(str)
- {
- return str.replace(/\W/g, '_');
- };
|