Initial OpenECOMP policy/engine commit
[policy/engine.git] / ecomp-sdk-app / src / main / webapp / WEB-INF / fusion / raptor / popup_drill_down_report.jsp
1 <%--
2   ================================================================================
3   eCOMP Portal SDK
4   ================================================================================
5   Copyright (C) 2017 AT&T Intellectual Property
6   ================================================================================
7   Licensed under the Apache License, Version 2.0 (the "License");
8   you may not use this file except in compliance with the License.
9   You may obtain a copy of the License at
10   
11        http://www.apache.org/licenses/LICENSE-2.0
12   
13   Unless required by applicable law or agreed to in writing, software
14   distributed under the License is distributed on an "AS IS" BASIS,
15   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   See the License for the specific language governing permissions and
17   limitations under the License.
18   ================================================================================
19   --%>
20 <%@ page import="java.util.*" %>
21
22 <%@ page import="org.openecomp.portalsdk.analytics.xmlobj.*" %>
23 <%@ page import="org.openecomp.portalsdk.analytics.model.*" %>
24 <%@ page import="org.openecomp.portalsdk.analytics.model.definition.*" %>
25 <%@ page import="org.openecomp.portalsdk.analytics.model.runtime.*" %>
26 <%@ page import="org.openecomp.portalsdk.analytics.system.*" %>
27 <%@ page import="org.openecomp.portalsdk.analytics.util.*" %>
28
29 <%      ReportDefinition rdef = (ReportDefinition) request.getSession().getAttribute(AppConstants.SI_REPORT_DEFINITION); 
30         List reportCols  = rdef.getAllColumns();
31         List rFormFields = null;
32         if(rdef.getFormFieldList()!=null&&rdef.getFormFieldList().getFormField().size()>0)
33                 rFormFields = rdef.getFormFieldList().getFormField();
34         
35         ReportFormFields ddReportFormFields = (ReportFormFields) request.getAttribute(AppConstants.RI_FORM_FIELDS); 
36         
37         String drillDownSuppress = AppUtils.getRequestNvlValue(request, "drillDownSuppress");
38         String drillDownParams   = AppUtils.getRequestNvlValue(request, "drillDownParams");
39         String drillDownRequest   = AppUtils.getRequestNvlValue(request, "drillDownRequest");
40         
41         Hashtable paramDefinitions = new Hashtable();
42         StringTokenizer st = new StringTokenizer(drillDownParams, "&");
43         //Added for passing request parameters in Drill Down
44     String[] reqParameters = Globals.getRequestParams().split(",");     
45     int icnt=0;
46     //
47         while(st.hasMoreTokens()) {
48                 String param = st.nextToken();
49                 DrillDownParamDef paramDef = new DrillDownParamDef(param);
50                 if(paramDef.getFieldName().length()>0)
51                         paramDefinitions.put(paramDef.getFieldName(), paramDef);
52         }       // while
53 %>
54
55 <html>
56 <head>
57         <title>Drill-down Parameters Configuration</title>
58         <link rel="stylesheet" type="text/css" href="<%= AppUtils.getBaseFolderURL() %>css/raptor.css">
59
60 <script language="JavaScript">
61 <!--
62         var bCloseWindow = false;
63
64         function setParams(newParams) {
65                 var suppressValue = document.dataform.v_suppress.value;
66                 var showInPopup;
67                 if(document.dataform.showInPopup.checked)
68                         showInPopup = "true";
69                 window.opener.document.forma.drillDownPopUp.value = showInPopup;
70                 window.opener.setDrillDownValuesSuppress(newParams, suppressValue);
71                 window.close();
72         }   // setParams
73
74         function resetDrillDown() {
75                 window.opener.document.forma.drillDownCtl.selectedIndex = 0;
76                 window.opener.document.forma.drillDownURL.value         = "";
77                 window.opener.document.forma.drillDownParams.value      = "";
78                 window.opener.document.forma.drillDownSuppress.value    = "";
79                 window.opener.document.forma.drillDownPopUp.value       = "";
80         }   // setParams
81
82
83 //-->
84 </script>
85
86 </head>
87 <body onLoad="if(bCloseWindow) setParams('');">
88
89 <form name="dataform" onSubmit="return false;">
90 <table class="mTAB" width="94%" border="0" cellspacing="1" cellpadding="3" align=center>
91         <tr>
92                 <td class=rbg1 colspan="2">
93                         <b class=rtableheader>DRILL-DOWN PARAMETERS CONFIGURATION</b>
94                 </td>
95         </tr>
96
97 <%      if(ddReportFormFields!=null)
98                 for(ddReportFormFields.resetNext(); ddReportFormFields.hasNext(); ) {
99                         FormField ff = ddReportFormFields.getNext(); 
100                         if(!ff.getFieldType().equals(FormField.FFT_BLANK)) {
101                         
102                         DrillDownParamDef paramDef = (DrillDownParamDef) paramDefinitions.get(ff.getFieldName());
103                         if(paramDef==null)
104                                 paramDef = new DrillDownParamDef(""); %>
105              
106             <% if (ff!=null && (ff.getValidationType().equals(FormField.VT_TIMESTAMP_HR) || ff.getValidationType().equals(FormField.VT_TIMESTAMP_MIN) || ff.getValidationType().equals(FormField.VT_TIMESTAMP_SEC)) ) {
107             %>
108         <tr>
109                 <td class=rbg1 colspan="2" height="30" align="left"><b class=rtableheader>
110                         &nbsp;<%= ff.getFieldDisplayName() %>
111                         <input type="hidden" name="paramName" value="<%= ff.getFieldName() %>"></b></td> 
112         </tr>
113         <tr>
114                 <td class=rbg2 align="left" width="33%" height="30" nowrap>
115                         <font class=rtabletext>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
116                         <input type="radio" name="r_<%= ff.getFieldName() %>" value="None"<%= paramDef.getValType().equals("0")?" checked":"" %>>No value </font>
117                 </td>
118                 <td class=rbg3 align="left" width="67%" nowrap>
119                         <font class=rtabletext>Accept default</font>
120                 </td>
121         </tr>
122         <tr>
123                 <td class=rbg2 align="left" height="30" nowrap>
124                         <font class=rtabletext>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
125                         <input type="radio" name="r_<%= ff.getFieldName() %>" value="Fixed"<%= paramDef.getValType().equals("1")?" checked":"" %>>Fixed value </font>
126                 </td>
127                 <td class=rbg3 align="left" nowrap><font class=rtabletext>
128                         <input type="text" size="30" maxlength="100" name="v_<%= ff.getFieldName() %>" value="<%= java.net.URLDecoder.decode(paramDef.getValValue(),"UTF8") %>" onChange="document.dataform.r_<%= ff.getFieldName() %>[1].click();"></font>
129                 </td>
130         </tr>
131         <tr>
132                 <td class=rbg2 align="left" height="30" nowrap>
133                         <font class=rtabletext>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
134                         <input type="radio" name="r_<%= ff.getFieldName() %>" value="Column"<%= paramDef.getValType().equals("2")?" checked":"" %>>Value of column </font>
135                 </td>
136                 <td class=rbg3 align="left" nowrap><font class=rtabletext>
137                         <select name="c_<%= ff.getFieldName() %>" onChange="document.dataform.r_<%= ff.getFieldName() %>[2].click();">
138                             <option value="this">--- Current drill-down column ---
139 <%                      for(Iterator iter=reportCols.iterator(); iter.hasNext(); ) { 
140                                 DataColumnType dct = (DataColumnType) iter.next(); 
141                                 //if(dct.isVisible()) { 
142                                 %>
143                             <option value="<%= dct.getColId() %>"<%= paramDef.getValColId().equals(dct.getColId())?" selected":"" %>><%= dct.getDisplayName() %>
144 <%                              //} 
145 %>
146 <%                      } %>
147                         </select></font>
148                 </td>
149         </tr>
150 <%                      if(rFormFields!=null) { %>
151         <tr>
152                 <td class=rbg2 align="left" height="30" nowrap>
153                         <font class=rtabletext>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
154                         <input type="radio" name="r_<%= ff.getFieldName() %>" value="FormField"<%= paramDef.getValType().equals("3")?" checked":"" %>>Value of form field </font>
155                 </td>
156                 <td class=rbg3 align="left" nowrap><font class=rtabletext>
157                         <select name="f_<%= ff.getFieldName() %>" onChange="document.dataform.r_<%= ff.getFieldName() %>[3].click();">
158 <%                              for(Iterator iter=rFormFields.iterator(); iter.hasNext(); ) { 
159                                         FormFieldType fft = (FormFieldType) iter.next(); %>
160                             <option value="<%= fft.getFieldId() %>"<%= paramDef.getValFieldId().equals(fft.getFieldId())?" selected":"" %>><%= fft.getFieldName() %>
161 <%                              } %>
162                         </select></font>
163                 </td>
164         </tr>
165         <tr>
166                 <td class=rbg2 align="left" height="30" nowrap>
167                         <font class=rtabletext>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
168                         <input type="radio" name="r_<%= ff.getFieldName() %>" value="ColFormSet"<%= paramDef.getValType().equals("4")?" checked":"" %>>Value set </font>
169                 </td>
170                 <td class=rbg3 align="left" nowrap><font class=rtabletext>
171                         Pass the value of the selected column if not empty,<br>
172                         otherwise pass the value of the selected form field</font>
173                 </td>
174         </tr>
175 <%                                      }       // if
176                                         
177 %>
178 <!--  END -->
179                                 <%
180                                 paramDef = (DrillDownParamDef) paramDefinitions.get(ff.getFieldName()+"_Hr");
181                                 if(paramDef==null)
182                                         paramDef = new DrillDownParamDef("");
183                                 %>
184                 <tr>
185                         <td class=rbg1 colspan="2" height="30" align="left"><b class=rtableheader>
186                                 &nbsp;<%= ff.getFieldDisplayName() %> (Hour)
187                                 <input type="hidden" name="paramName" value="<%= ff.getFieldName() %>_Hr"></b></td> 
188                         </tr>
189                                 <tr>
190                                         <td class=rbg2 align="left" width="33%" height="30" nowrap>
191                                                 <font class=rtabletext>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
192                                                 <input type="radio" name="r_<%= ff.getFieldName() %>_Hr" value="None"<%= paramDef.getValType().equals("0")?" checked":"" %>>No value </font>
193                                         </td>
194                                         <td class=rbg3 align="left" width="67%" nowrap>
195                                                 <font class=rtabletext>Accept default</font>
196                                         </td>
197                                 </tr>
198                                 <tr>
199                                         <td class=rbg2 align="left" height="30" nowrap>
200                                                 <font class=rtabletext>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
201                                                 <input type="radio" name="r_<%= ff.getFieldName() %>_Hr" value="Column" <%= paramDef.getValType().equals("2")?" checked":"" %> >Value of column </font>
202                                         </td>
203                                         <td class=rbg3 align="left" nowrap>
204                                                 <font class=rtabletext>
205                                                         <select name="c_<%= ff.getFieldName() %>_Hr" onChange="document.dataform.r_<%= ff.getFieldName() %>_Hr[1].click();">
206                                                         <option value="this">--- Current drill-down column ---
207                                         <%                      for(Iterator iter=reportCols.iterator(); iter.hasNext(); ) { 
208                                                                         DataColumnType dct = (DataColumnType) iter.next(); 
209                                                                         //if(dct.isVisible()) { 
210                                         %>
211                                                                 <option value="<%= dct.getColId() %>"<%= paramDef.getValColId().equals(dct.getColId())?" selected":"" %>><%= dct.getDisplayName() %>
212                 <%                              //} 
213                 %>
214 <%                                                              } %>
215                                                         </select>
216                                         </font>
217                                         </td>
218                         </tr>
219 <%
220                                   if (ff.getValidationType().equals(FormField.VT_TIMESTAMP_MIN) || ff.getValidationType().equals(FormField.VT_TIMESTAMP_SEC)) {
221 %>
222                                 <%
223                                 paramDef = (DrillDownParamDef) paramDefinitions.get(ff.getFieldName()+"_Min");
224                                 if(paramDef==null)
225                                         paramDef = new DrillDownParamDef("");
226                                 %>
227                 <tr>
228                         <td class=rbg1 colspan="2" height="30" align="left"><b class=rtableheader>
229                                 &nbsp;<%= ff.getFieldDisplayName() %> (Minutes)
230                                 <input type="hidden" name="paramName" value="<%= ff.getFieldName() %>_Min"></b></td> 
231                         </tr>
232                                 <tr>
233                                         <td class=rbg2 align="left" width="33%" height="30" nowrap>
234                                                 <font class=rtabletext>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
235                                                 <input type="radio" name="r_<%= ff.getFieldName() %>_Min" value="None"<%= paramDef.getValType().equals("0")?" checked":"" %>>No value </font>
236                                         </td>
237                                         <td class=rbg3 align="left" width="67%" nowrap>
238                                                 <font class=rtabletext>Accept default</font>
239                                         </td>
240                                 </tr>
241                                 <tr>
242                                         <td class=rbg2 align="left" height="30" nowrap>
243                                                 <font class=rtabletext>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
244                                                 <input type="radio" name="r_<%= ff.getFieldName() %>_Min" value="Column" <%= paramDef.getValType().equals("2")?" checked":"" %>>Value of column </font>
245                                         </td>
246                                         <td class=rbg3 align="left" nowrap>
247                                                 <font class=rtabletext>
248                                                         <select name="c_<%= ff.getFieldName() %>_Min" onChange="document.dataform.r_<%= ff.getFieldName() %>_Min[1].click();">
249                                                         <option value="this">--- Current drill-down column ---
250                                         <%                      for(Iterator iter=reportCols.iterator(); iter.hasNext(); ) { 
251                                                                         DataColumnType dct = (DataColumnType) iter.next(); 
252                                                                         //if(dct.isVisible()) { 
253                                         %>
254                                                                 <option value="<%= dct.getColId() %>"<%= paramDef.getValColId().equals(dct.getColId())?" selected":"" %>><%= dct.getDisplayName() %>
255                 <%                              //} 
256                 %>
257 <%                                                              } %>
258                                                         </select>
259                                         </font>
260                                         </td>
261                         </tr>
262 <%                                        
263                                   }
264                                   if(ff.getValidationType().equals(FormField.VT_TIMESTAMP_SEC)) {
265 %>
266                                 <%
267                                 paramDef = (DrillDownParamDef) paramDefinitions.get(ff.getFieldName()+"_Sec");
268                                 if(paramDef==null)
269                                         paramDef = new DrillDownParamDef("");
270                                 %>
271                 <tr>
272                         <td class=rbg1 colspan="2" height="30" align="left"><b class=rtableheader>
273                                 &nbsp;<%= ff.getFieldDisplayName() %> (Seconds)
274                                 <input type="hidden" name="paramName" value="<%= ff.getFieldName() %>_Sec"></b></td> 
275                         </tr>
276                                 <tr>
277                                         <td class=rbg2 align="left" width="33%" height="30" nowrap>
278                                                 <font class=rtabletext>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
279                                                 <input type="radio" name="r_<%= ff.getFieldName() %>_Sec" value="None"<%= paramDef.getValType().equals("0")?" checked":"" %>>No value </font>
280                                         </td>
281                                         <td class=rbg3 align="left" width="67%" nowrap>
282                                                 <font class=rtabletext>Accept default</font>
283                                         </td>
284                                 </tr>
285                                 <tr>
286                                         <td class=rbg2 align="left" height="30" nowrap>
287                                                 <font class=rtabletext>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
288                                                 <input type="radio" name="r_<%= ff.getFieldName() %>_Sec" value="Column" <%= paramDef.getValType().equals("2")?" checked":"" %>>Value of column </font>
289                                         </td>
290                                         <td class=rbg3 align="left" nowrap>
291                                                 <font class=rtabletext>
292                                                         <select name="c_<%= ff.getFieldName() %>_Sec" onChange="document.dataform.r_<%= ff.getFieldName() %>_Sec[1].click();">
293                                                         <option value="this">--- Current drill-down column ---
294                                         <%                      for(Iterator iter=reportCols.iterator(); iter.hasNext(); ) { 
295                                                                         DataColumnType dct = (DataColumnType) iter.next(); 
296                                                                         //if(dct.isVisible()) { 
297                                         %>
298                                                                 <option value="<%= dct.getColId() %>"<%= paramDef.getValColId().equals(dct.getColId())?" selected":"" %>><%= dct.getDisplayName() %>
299                 <%                              //} 
300                 %>
301 <%                                                              } %>
302                                                         </select>
303                                         </font>
304                                         </td>
305                         </tr>
306 <%                                        
307                 
308                                   }
309                                                           
310                } else {         
311 %> 
312         <tr>
313                 <td class=rbg1 colspan="2" height="30" align="left"><b class=rtableheader>
314                         &nbsp;<%= ff.getFieldDisplayName() %>
315                         <input type="hidden" name="paramName" value="<%= ff.getFieldName() %>"></b></td> 
316         </tr>
317         <tr>
318                 <td class=rbg2 align="left" width="33%" height="30" nowrap>
319                         <font class=rtabletext>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
320                         <input type="radio" name="r_<%= ff.getFieldName() %>" value="None"<%= paramDef.getValType().equals("0")?" checked":"" %>>No value </font>
321                 </td>
322                 <td class=rbg3 align="left" width="67%" nowrap>
323                         <font class=rtabletext>Accept default</font>
324                 </td>
325         </tr>
326         <tr>
327                 <td class=rbg2 align="left" height="30" nowrap>
328                         <font class=rtabletext>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
329                         <input type="radio" name="r_<%= ff.getFieldName() %>" value="Fixed"<%= paramDef.getValType().equals("1")?" checked":"" %>>Fixed value </font>
330                 </td>
331                 <td class=rbg3 align="left" nowrap><font class=rtabletext>
332                         <input type="text" size="30" maxlength="100" name="v_<%= ff.getFieldName() %>" value="<%= java.net.URLDecoder.decode(paramDef.getValValue(),"UTF8") %>" onChange="document.dataform.r_<%= ff.getFieldName() %>[1].click();"></font>
333                 </td>
334         </tr>
335         <tr>
336                 <td class=rbg2 align="left" height="30" nowrap>
337                         <font class=rtabletext>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
338                         <input type="radio" name="r_<%= ff.getFieldName() %>" value="Column"<%= paramDef.getValType().equals("2")?" checked":"" %>>Value of column </font>
339                 </td>
340                 <td class=rbg3 align="left" nowrap><font class=rtabletext>
341                         <select name="c_<%= ff.getFieldName() %>" onChange="document.dataform.r_<%= ff.getFieldName() %>[2].click();">
342                             <option value="this">--- Current drill-down column ---
343 <%                      for(Iterator iter=reportCols.iterator(); iter.hasNext(); ) { 
344                                 DataColumnType dct = (DataColumnType) iter.next(); 
345                                 //if(dct.isVisible()) { 
346                                 %>
347                             <option value="<%= dct.getColId() %>"<%= paramDef.getValColId().equals(dct.getColId())?" selected":"" %>><%= dct.getDisplayName() %>
348 <%                              //} 
349 %>
350 <%                      } %>
351                         </select></font>
352                 </td>
353         </tr>
354 <%                      if(rFormFields!=null) { %>
355         <tr>
356                 <td class=rbg2 align="left" height="30" nowrap>
357                         <font class=rtabletext>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
358                         <input type="radio" name="r_<%= ff.getFieldName() %>" value="FormField"<%= paramDef.getValType().equals("3")?" checked":"" %>>Value of form field </font>
359                 </td>
360                 <td class=rbg3 align="left" nowrap><font class=rtabletext>
361                         <select name="f_<%= ff.getFieldName() %>" onChange="document.dataform.r_<%= ff.getFieldName() %>[3].click();">
362 <%                              for(Iterator iter=rFormFields.iterator(); iter.hasNext(); ) { 
363                                         FormFieldType fft = (FormFieldType) iter.next(); %>
364                             <option value="<%= fft.getFieldId() %>"<%= paramDef.getValFieldId().equals(fft.getFieldId())?" selected":"" %>><%= fft.getFieldName() %>
365 <%                              } %>
366                         </select></font>
367                 </td>
368         </tr>
369         <tr>
370                 <td class=rbg2 align="left" height="30" nowrap>
371                         <font class=rtabletext>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
372                         <input type="radio" name="r_<%= ff.getFieldName() %>" value="ColFormSet"<%= paramDef.getValType().equals("4")?" checked":"" %>>Value set </font>
373                 </td>
374                 <td class=rbg3 align="left" nowrap><font class=rtabletext>
375                         Pass the value of the selected column if not empty,<br>
376                         otherwise pass the value of the selected form field</font>
377                 </td>
378         </tr>
379 <%                      }       // if
380                } // else
381                         } // if BLANK      
382                 }   // for 
383 %>
384
385 <script language="JavaScript">
386 <!--
387 <% if(ddReportFormFields==null||ddReportFormFields.getFieldCount()==0) { %>
388         bCloseWindow = true;
389 <% } %>
390         function replaceSC(strValue) {
391                 var newValue = "";
392                 
393                 for(var i=0; i<strValue.length; i++) {
394                         var ch = strValue.charAt(i);
395                         
396                         if(ch=='@')
397                                 newValue += "%40";
398                         else if(ch=='+')
399                                 newValue += "%2B";
400                         else if(ch=='/')
401                                 newValue += "%2F";
402                         else
403                                 newValue += ch;
404                 }       // for
405                 
406                 return newValue;
407         }       // replaceSC
408
409         function collectValues() {
410                 var newParams = "";
411           newParams += setCheckBoxValues();
412 <%      if(ddReportFormFields!=null) {
413                 for(ddReportFormFields.resetNext(); ddReportFormFields.hasNext(); ) {
414                         FormField ff = ddReportFormFields.getNext(); 
415                         if(!ff.getFieldType().equals(FormField.FFT_BLANK)) {
416                         String fieldName = ff.getFieldName(); 
417                         
418                         if (ff!=null && !(ff.getValidationType().equals(FormField.VT_TIMESTAMP_HR) || ff.getValidationType().equals(FormField.VT_TIMESTAMP_MIN) || ff.getValidationType().equals(FormField.VT_TIMESTAMP_SEC)) ) {
419 %>                              
420                 if(document.dataform.r_<%= fieldName %>[1].checked||document.dataform.r_<%= fieldName %>[2].checked<%= (rFormFields!=null)?"||document.dataform.r_"+fieldName+"[3].checked||document.dataform.r_"+fieldName+"[4].checked":"" %>) {
421                         if(newParams!="")
422                                 newParams += "&";
423                         newParams += "<%= fieldName %>=";
424                         if(document.dataform.r_<%= fieldName %>[1].checked) {
425                                 newParams += replaceSC(escape(document.dataform.v_<%= fieldName %>.value));
426                         } else if(document.dataform.r_<%= fieldName %>[2].checked) {
427                                 newParams += "["+escape(document.dataform.c_<%= fieldName %>.options[document.dataform.c_<%= fieldName %>.selectedIndex].value)+"]";
428                         <% if(rFormFields!=null) { %>
429                         } else if(document.dataform.r_<%= fieldName %>[3].checked) {
430                                 newParams += "[!"+escape(document.dataform.f_<%= fieldName %>.options[document.dataform.f_<%= fieldName %>.selectedIndex].value)+"]";
431                         } else if(document.dataform.r_<%= fieldName %>[4].checked) {
432                                 newParams += "["+escape(document.dataform.c_<%= fieldName %>.options[document.dataform.c_<%= fieldName %>.selectedIndex].value)+"!"+escape(document.dataform.f_<%= fieldName %>.options[document.dataform.f_<%= fieldName %>.selectedIndex].value)+"]";
433                         <% } %>
434                         }
435                 }   // if
436 <%      
437  } //if non-timestamp
438                         if (ff!=null && (ff.getValidationType().equals(FormField.VT_TIMESTAMP_HR) || ff.getValidationType().equals(FormField.VT_TIMESTAMP_MIN) || ff.getValidationType().equals(FormField.VT_TIMESTAMP_SEC)) ) {
439  
440                         if(ff.getValidationType().equals(FormField.VT_TIMESTAMP_HR) || ff.getValidationType().equals(FormField.VT_TIMESTAMP_MIN) || ff.getValidationType().equals(FormField.VT_TIMESTAMP_SEC)) {
441 %>
442                 if(document.dataform.r_<%= fieldName %>[1].checked||document.dataform.r_<%= fieldName %>[2].checked<%= (rFormFields!=null)?"||document.dataform.r_"+fieldName+"[3].checked||document.dataform.r_"+fieldName+"[4].checked":"" %>) {
443                         if(newParams!="")
444                                 newParams += "&";
445                         newParams += "<%= fieldName %>=";
446                         if(document.dataform.r_<%= fieldName %>[1].checked) {
447                                 newParams += replaceSC(escape(document.dataform.v_<%= fieldName %>.value));
448                         } else if(document.dataform.r_<%= fieldName %>[2].checked) {
449                                 newParams += "["+escape(document.dataform.c_<%= fieldName %>.options[document.dataform.c_<%= fieldName %>.selectedIndex].value)+"]";
450                         <% if(rFormFields!=null) { %>
451                         } else if(document.dataform.r_<%= fieldName %>[3].checked) {
452                                 newParams += "[!"+escape(document.dataform.f_<%= fieldName %>.options[document.dataform.f_<%= fieldName %>.selectedIndex].value)+"]";
453                         } else if(document.dataform.r_<%= fieldName %>[4].checked) {
454                                 newParams += "["+escape(document.dataform.c_<%= fieldName %>.options[document.dataform.c_<%= fieldName %>.selectedIndex].value)+"!"+escape(document.dataform.f_<%= fieldName %>.options[document.dataform.f_<%= fieldName %>.selectedIndex].value)+"]";
455                         <% } %>
456                         }
457                 }   // if                               
458
459                                 if(document.dataform.r_<%= fieldName %>_Hr[1].checked) {
460                                         if(newParams!="")
461                                                 newParams += "&";
462                                         newParams += "<%= fieldName %>_Hr=";
463                                         if(document.dataform.r_<%= fieldName %>_Hr[1].checked) {
464                                                 newParams += "["+escape(document.dataform.c_<%= fieldName %>_Hr.options[document.dataform.c_<%= fieldName %>_Hr.selectedIndex].value)+"]";
465                                         }
466                                 }   // if                               
467 <%
468                         }//hour
469 %>
470 <%                              
471                         if(ff.getValidationType().equals(FormField.VT_TIMESTAMP_MIN) || ff.getValidationType().equals(FormField.VT_TIMESTAMP_SEC)) {
472 %>
473                                 if(document.dataform.r_<%= fieldName %>_Min[1].checked) {
474                                         if(newParams!="")
475                                                 newParams += "&";
476                                         newParams += "<%= fieldName %>_Min=";
477                                         if(document.dataform.r_<%= fieldName %>_Min[1].checked) {
478                                                 newParams += "["+escape(document.dataform.c_<%= fieldName %>_Min.options[document.dataform.c_<%= fieldName %>_Min.selectedIndex].value)+"]";
479      }
480                         }   // if
481                         <%
482                         } // min
483                         if(ff.getValidationType().equals(FormField.VT_TIMESTAMP_SEC)) {
484 %>
485                                 if(document.dataform.r_<%= fieldName %>_Sec[1].checked) {
486                                         if(newParams!="")
487                                                 newParams += "&";
488                                         newParams += "<%= fieldName %>_Sec=";
489                                         if(document.dataform.r_<%= fieldName %>_Sec[1].checked) {
490                                                 newParams += "["+escape(document.dataform.c_<%= fieldName %>_Sec.options[document.dataform.c_<%= fieldName %>_Sec.selectedIndex].value)+"]";
491                                 }
492                         }   // if                                                       
493 <%
494                 } // sec
495                 }
496         } // BLANK
497                 }       // for 
498      }
499 %>
500         //alert(newParams);
501                 setParams(newParams);
502         }   // collectValues
503
504         function setCheckBoxValues() {
505                 var newValues ="";
506 <%
507         icnt=0;
508         if(reqParameters.length>0) {
509 %>
510          if(document.dataform.requestParam) {  
511           for (i=0;i<document.dataform.requestParam.length;i++) {
512             <% icnt++;%>          
513             if(document.dataform.requestParam[i].checked) {
514               newValues += escape("<%=reqParameters[icnt-1]%>")+"="+"[#"+escape("<%=reqParameters[icnt-1]%>")+"]";
515             }
516          }
517          }
518 <% } %>
519       return newValues;
520         } 
521
522 //-->
523 </script>
524
525         <tr>
526                 <td colspan="2">&nbsp;</td> 
527         </tr>
528         <tr>
529                 <td class=rbg1 colspan="2" height="30" align="left"><b class=rtableheader>
530                         &nbsp;Parameter values not to be passed to the drill-down report</b></td> 
531         </tr>
532         <tr>
533                 <td class=rbg2 align="left" height="30" nowrap>
534                         <font class=rtabletext>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
535                         Suppress values </font>
536                 </td>
537                 <td class=rbg3 align="left" nowrap><font class=rtabletext>
538                         <input type="text" size="30" maxlength="100" name="v_suppress" value="<%= drillDownSuppress %>">
539                         <br>separate by | if multiple values</font>
540                 </td>
541         </tr>
542         <tr>
543                 <td colspan="2">&nbsp;</td> 
544         </tr>
545         <% if(!Globals.getPassRequestParamInDrilldown() && (!(reqParameters.length==1 && reqParameters[0].length()<=0))) { 
546                 %>
547         <tr>
548                 <td class=rbg1 colspan="2" height="30" align="left"><b class=rtableheader>
549                         &nbsp;Request Parameter values to be passed to the drill-down report</b></td> 
550         </tr>
551         <!-- <tr>
552                 <td class=rbg2 align="left" height="30" nowrap>
553                         <font class=rtabletext>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
554                         Request values </font>
555                 </td>
556          </tr>
557          -->
558                 <%
559         icnt=0;
560  
561         for (int i = 0; i < reqParameters.length; i++) { 
562           icnt++;
563                        
564         %>
565         <tr<%= (icnt%2==0)?" class=rowalt1":" class=rowalt2" %>>
566                 <!--<td align="center" height="30"><font class=rtabletext><%= icnt %></font></td>-->
567                 <td><font class=rtabletext><%= reqParameters[i]%></font></td>
568                 <td class=rbg3 align="left" nowrap><font class=rtabletext>
569           <input type="checkbox" name="requestParam" <%= ((drillDownRequest!=null)&&(drillDownRequest.indexOf(reqParameters[i])!=-1))?"checked":""%>>
570                 </td>
571                 </tr>
572                 <%
573                 } //for
574                 %>
575                  <input type="hidden" name="requestParam">
576                 <%
577                 } // if requestParam 
578                 %>
579         <tr> 
580                         <td class=rbg3 align="left" nowrap><font class=rtabletext>
581                          Show Drilled Down Report In Popup Window: <input type="checkbox" name="showInPopup">
582                         </td>
583                 </tr>
584
585         <tr>
586                 <td colspan="3" align="center"><input type="Button" class=button value="Complete" onClick="collectValues()"></td>
587         </tr>
588 </table>
589 </form>
590         <br><br>
591  <script>
592     if(window.opener.document.forma.drillDownPopUp.value == 'true')
593         document.dataform.showInPopup.checked = true;
594         
595  </script>
596 </body>
597 </html>
598
599 <%!     private String nvl(String s)                  { return (s==null)?"":s; }
600         private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } %>
601