2 ================================================================================
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
11 http://www.apache.org/licenses/LICENSE-2.0
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 ================================================================================
21 Name: wizard_adhoc_schedule.jsp
22 Use : This JSP is used for accepting user parameters for scheduling the report.
27 28-Aug-2009 : Version 8.4 (Sundar); initFormFields function is removed as it is handled in back end.
28 23-Jun-2009 : Version 8.4 (Sundar);
31 <LI> Bug related to creating startDate variable (in Javascript) for the Validation purpose is fixed.</LI>
37 <%@ page import="org.openecomp.portalsdk.analytics.xmlobj.DataColumnType" %>
38 <%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %>
39 <%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportDefinition" %>
40 <%@ page import="org.openecomp.portalsdk.analytics.system.AppUtils" %>
41 <%@ page import="org.openecomp.portalsdk.analytics.system.Globals" %>
42 <%@ page import="org.openecomp.portalsdk.analytics.controller.WizardSequence" %>
43 <%@ page import="java.util.Vector" %>
44 <%@ page import="java.util.List" %>
45 <%@ page import="org.openecomp.portalsdk.analytics.model.DataCache" %>
46 <%@ page import="java.util.Iterator" %>
47 <%@ page import="org.openecomp.portalsdk.analytics.xmlobj.DataSourceType" %>
48 <%@ page import="org.openecomp.portalsdk.analytics.model.definition.DBColumnInfo" %>
49 <%@ page import="org.openecomp.portalsdk.analytics.model.definition.TableSource" %>
50 <%@ page import="org.openecomp.portalsdk.analytics.model.base.IdNameValue" %>
51 <%@ page import="org.openecomp.portalsdk.analytics.xmlobj.SemaphoreType" %>
52 <%@ page import="org.openecomp.portalsdk.analytics.xmlobj.FormFieldType" %>
53 <%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportSchedule" %>
54 <%@ page import="org.openecomp.portalsdk.analytics.util.Utils" %>
57 ReportSchedule reportSchedule = (ReportSchedule) request.getSession().getAttribute(AppConstants.SI_REPORT_SCHEDULE);
58 ReportDefinition rdefRecurrance = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION);
59 session.setAttribute("login_id", AppUtils.getUserBackdoorLoginId(request));
60 if(reportSchedule==null) reportSchedule = (ReportSchedule) request.getAttribute(AppConstants.SI_REPORT_SCHEDULE);
61 String remoteDbPrefix = (String) session.getAttribute("remoteDB");
62 boolean isSQLAllowed = Globals.getAllowSQLBasedReports();
64 <%@page import="java.util.Calendar"%>
65 <%@page import="java.text.DateFormat"%>
66 <%@page import="java.text.SimpleDateFormat"%>
67 <%@page import="java.util.TimeZone"%>
68 <%@page import="java.util.Date"%>
69 <%@page import="org.openecomp.portalsdk.analytics.model.ReportLoader"%>
70 <script language="JavaScript">
72 function showTestConditionPopup() {
73 var w = window.open("<%= AppUtils.getRaptorActionURL() %>report.popup.test.cond&remoteDbPrefix=<%=remoteDbPrefix%>&<%= AppConstants.RI_FORMATTED_SQL %>="+escape(""+document.forma.conditionSQL.value), "testCondSQLPopup", "width=450,height=180,location=no,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes");
76 } // showTestConditionPopup
78 function exclusiveCheckBox(which) {
80 for (i=0; i<size; i++) {
81 if(document.getElementById("notify" + i) != which) {
82 document.getElementById("notify" + i).checked = false;
85 //alert("exclusive " + which.form.notify_type.value);
89 <script language="javascript" src="<%= AppUtils.getBaseFolderURL() %>js/other_scripts.js"></script>
90 <script type="text/javascript" src="<%= AppUtils.getBaseFolderURL() %>js/CalendarPopup.js"></script>
91 <script language="JavaScript" src="<%= AppUtils.getBaseFolderURL() %>js/rounded-corners.js"></script>
92 <script language="JavaScript" src="<%= AppUtils.getBaseFolderURL() %>js/form-field-tooltip.js"></script>
93 <link rel="stylesheet" type="text/css" href="<%= AppUtils.getBaseFolderURL() %>css/calendar.css">
95 <script type="text/javascript">
97 var delay=0;//delay in milliseconds
101 var oIfr = document.getElementById('calendarFrame');
102 var oCal = document.getElementById('calendarDiv');
103 oIfr.style.display=(oCal.style.display=='block')?'none':'block';
104 oIfr.style.top=findPosY()
105 oIfr.style.left=findPosX()-5
110 // added to show Iframe behind calender
111 var oIfr = document.getElementById('calendarFrame');
112 var oCal = document.getElementById('calendarDiv');
113 oIfr.style.display=(oCal.style.display=='none')?'block':'none';
123 curleft += obj.offsetLeft;
124 if(!obj.offsetParent)
126 obj = obj.offsetParent;
142 curtop += obj.offsetTop;
143 if(!obj.offsetParent)
145 obj = obj.offsetParent;
156 <iframe id="calendarFrame" class="nav" z-index:199; scrolling="no" frameborder="0" width=165px height=165px src="" style="position:absolute; display:none;">
159 <div id="calendarDiv" name="calendarDiv" style="position:absolute; z-index:200; visibility:none; background-color:white;layer-background-color:white;"></div>
161 Calendar startCalendarDate = Calendar.getInstance();
162 startCalendarDate.add(Calendar.DAY_OF_MONTH, - 540);
163 Calendar endCalendarDate = Calendar.getInstance();
164 endCalendarDate.add(Calendar.DAY_OF_MONTH, 540);
165 SimpleDateFormat dtf = new SimpleDateFormat("MM/dd/yyyy");
166 SimpleDateFormat oracleDateFormat = new SimpleDateFormat("MM/dd/yyyy kk:mm:ss");
167 Date sysdate = oracleDateFormat.parse(ReportLoader.getSystemDateTime());
168 SimpleDateFormat dtimestamp = new SimpleDateFormat(Globals.getScheduleDatePattern());
169 Calendar systemCalendar = Calendar.getInstance();
170 systemCalendar.setTime(sysdate);
171 Date sysNext15date = oracleDateFormat.parse(ReportLoader.getNext15MinutesOfSystemDateTime());
172 //dtimestamp = new SimpleDateFormat(Globals.getScheduleDatePattern());
173 Calendar systemNext15Calendar = Calendar.getInstance();
174 systemNext15Calendar.setTime(sysNext15date);
175 Date sysNext30date = oracleDateFormat.parse(ReportLoader.getNext30MinutesOfSystemDateTime());
176 //dtimestamp = new SimpleDateFormat(Globals.getScheduleDatePattern());
177 Calendar systemNext30Calendar = Calendar.getInstance();
178 systemNext30Calendar.setTime(sysNext30date);
180 System.out.println(" systemNext15Calendar " + systemNext15Calendar);
181 System.out.println(" systemNext30Calendar " + systemNext30Calendar);
183 //dtimestamp.setTimeZone(TimeZone.getTimeZone(Globals.getTimeZone()));
190 <SCRIPT LANGUAGE="JavaScript">
191 var oCalendar = new CalendarPopup("calendarDiv", "calendarFrame");
193 oCalendar.addDisabledDates(null, "<%=dtf.format(startCalendarDate.getTime())%>");
194 oCalendar.addDisabledDates("<%=dtf.format(endCalendarDate.getTime())%>", null);
197 oCalendar.setCssPrefix("raptor");
199 function fillStartEndDate(varSelect) {
201 <% if(!(nvl(reportSchedule.getStartDate()).length() > 0)) { %>
203 for (var i = 0; i < varSelect.options.length; i++) {
204 if (varSelect.options[ i ].selected) {
205 if(!(varSelect.options[i].value.length > 0)) {
207 //alert(d.getMonth() + " " + d.getDate() + " " + d.getYear());
208 //alert(d.getMonth()+1+"/"+d.getDate()+"/"+d.getYear());
209 document.forma.schedStartDate.value = addZero(d.getMonth()+1)+"/"+addZero(d.getDate())+"/"+addZero(d.getYear());
210 document.forma.schedEndDate.value = addZero(d.getMonth()+1)+"/"+addZero(d.getDate())+"/"+addZero(d.getYear());
211 //alert(document.forma.schedStartDate.value);
219 document.forma.schedStartDate.value = "";
220 document.forma.schedEndDate.value = "";
225 function initStartEndDate() {
227 var varSelect = document.forma.schedRecurrence;
230 d.setFullYear(<%=systemCalendar.get(Calendar.YEAR)%>, <%=systemCalendar.get(Calendar.MONTH)%>,<%=systemCalendar.get(Calendar.DAY_OF_MONTH)%>);
231 d.setHours(<%=systemCalendar.get(Calendar.HOUR_OF_DAY)%>);
232 d.setMinutes(<%=systemCalendar.get(Calendar.MINUTE)%>);
233 d.setSeconds(<%=systemCalendar.get(Calendar.SECOND)%>);
235 d_end.setFullYear(<%=systemNext15Calendar.get(Calendar.YEAR)%>, <%=systemNext15Calendar.get(Calendar.MONTH)%>,<%=systemNext15Calendar.get(Calendar.DAY_OF_MONTH)%>);
236 d_end.setHours(<%=23%>);
237 d_end.setMinutes(<%=45%>);
238 d_end.setSeconds(<%=systemNext15Calendar.get(Calendar.SECOND)%>);
240 if(d.getHours() == 23 && d.getMinutes()>=30) {
241 d_end.setFullYear(<%=systemNext30Calendar.get(Calendar.YEAR)%>, <%=systemNext30Calendar.get(Calendar.MONTH)%>,<%=systemNext30Calendar.get(Calendar.DAY_OF_MONTH)%>);
242 d_end.setHours(<%=23%>);
243 d_end.setMinutes(<%=45%>);
244 d_end.setSeconds(<%=systemNext30Calendar.get(Calendar.SECOND)%>);
245 document.forma.schedEndDate.value = addZero(d_end.getMonth()+1)+"/"+addZero(d_end.getDate())+"/"+addZero(d_end.getYear());
246 var obj = document.forma.schedEndHour;
247 var hr = d_end.getHours();
248 //alert("end hr " + hr);
249 //if(d_end.getMinutes()>=45)
251 if(hr > 12) hr = hr - 12;
253 for (var i=0; i<obj.options.length; i++) {
254 if (eval(obj.options[i].value) == hr) {
255 obj.options[i].selected = true;
259 var obj1 = document.forma.schedEndMin;
260 for (var i=0; i<obj1.options.length; i++) {
261 if (d_end.getMinutes() <= eval(obj1.options[i].value)) {
262 obj1.options[i].selected = true;
266 var obj2 = document.forma.schedEndAMPM;
268 for (var i=0; i<obj2.options.length; i++) {
269 if (d_end.getHours() < 12 && obj2.options[i].value == 'AM') {
270 obj2.options[i].selected = true;
271 } else if (d_end.getHours() >= 12 && obj2.options[i].value == 'PM')
272 obj2.options[i].selected = true;
278 <% if(!(nvl(reportSchedule.getStartDate()).length() > 0)) { %>
280 //alert(d.getMonth() + " " + d.getDate() + " " + d.getYear());
281 //alert(d.getMonth()+1+"/"+d.getDate()+"/"+d.getYear());
282 //alert(d.getHours());
283 <%-- System.out.println(reportSchedule.getStartDate());
284 if(!(nvl(reportSchedule.getStartDate()).length() > 0)) { --%>
285 if(d.getHours() == 23 && d.getMinutes() > 45) {
286 //d.setDate(d.getDate() + 1);
287 document.forma.schedStartDate.value = addZero(d.getMonth()+1)+"/"+addZero(d.getDate()+1)+"/"+addZero(d.getYear());
290 document.forma.schedStartDate.value = addZero(d.getMonth()+1)+"/"+addZero(d.getDate())+"/"+addZero(d.getYear());
291 //document.forma.schedEndDate.value = addZero(d.getMonth()+1)+"/"+addZero(d.getDate())+"/"+addZero(d.getYear());
292 document.forma.schedEndDate.value = addZero(d_end.getMonth()+1)+"/"+addZero(d_end.getDate())+"/"+addZero(d_end.getYear());
294 var obj = document.forma.schedHour;
295 var hr = d.getHours();
296 if(d.getMinutes()>=45)
298 if(hr > 12) hr = hr - 12;
300 for (var i=0; i<obj.options.length; i++) {
301 if (eval(obj.options[i].value) == hr) {
302 obj.options[i].selected = true;
306 var obj1 = document.forma.schedMin;
307 for (var i=0; i<obj1.options.length; i++) {
308 if (d.getMinutes() <= eval(obj1.options[i].value)) {
309 obj1.options[i].selected = true;
313 var obj2 = document.forma.schedAMPM;
315 for (var i=0; i<obj2.options.length; i++) {
316 //alert(d.getHours() + " " + d.getMinutes());
317 if(d.getHours() == 23 && d.getMinutes() >= 45) {
318 if(obj2.options[i].value == 'AM') {
320 obj2.options[i].selected = true;
324 if ((d.getHours() < 12) && obj2.options[i].value == 'AM') {
325 obj2.options[i].selected = true;
326 } else if ((d.getHours() >= 12) && obj2.options[i].value == 'PM') {
327 obj2.options[i].selected = true;
337 function addZero(num) {
343 else return ""+numInt;
346 <table width="100%" border="0" cellspacing="1" cellpadding="3" align=center>
348 <td class=rbg1 colspan="2" align="left">
349 <%if(nvl(Globals.getScheduleHelpMessage()).trim().length()>0) { %>
350 <a href="javascript:uitmpl_qh('sch_help_text'); if(typeof window.parent.resizeWindow == 'function') window.parent.resizeWindow();" class="qh-link" style="position:fixed;"></a>
352 <b class=rtableheader>Please enter Time in <%= Globals.getTimeZone()%>. The Current System Time is <%=dtimestamp.format(sysdate)%> <%=Globals.getTimeZone()%></b>
357 <%if(nvl(Globals.getScheduleHelpMessage()).length()>0) { %>
359 <td colspan="2" class="nopad"><!-- quick help text -->
360 <div id="sch_help_text" class="mQH">
361 <p><span class="label">Report Desc:</span>
362 <%= Globals.getScheduleHelpMessage() %></p>
364 <!-- /quick help text --></td>
369 <td class=rbg2 align="right" width="25%" height="30"><font class=rtabletext>Schedule Emails: </font></td>
370 <td class=rbg3 align="left" width="50%" valign="middle" nowrap><font class=rtabletext>
371 <input type='radio' name='schedEnabled' id='schedEnabled' value='Y' <%= reportSchedule.getSchedEnabled().equals("Y")?" checked":"" %> toolTipText="This is used for the enabling or disabling the scheduling feature for this report."/>Yes
373 <input type='radio' name='schedEnabled' id='schedEnabled' value='N' <%= reportSchedule.getSchedEnabled().equals("N")?" checked":"" %> toolTipText="This is used for the enabling or disabling the scheduling feature for this report."/>No
378 <td class=rbg2 align="right" width="25%" height="30"><font class=rtabletext>Email Attachment:</font></td>
379 <td class=rbg3 align="left" width="50%" valign="middle" nowrap>
380 <font class=rtabletext>
381 <%if(!rdefRecurrance.getReportType().equals(AppConstants.RT_HIVE)) {%>
382 <input type='radio' name='notify' id='notify' value='2' <%= reportSchedule.getNotify_type().equals("2")?" checked":(reportSchedule.getNotify_type().length()<=0)?" checked":(!reportSchedule.getNotify_type().equals("4"))? " checked " :"" %> toolTipText="Provides the capability to attach reports as PDF format to the email."/>PDF Attachment
384 <input type='radio' name='notify' id='notify' value='4' <%= reportSchedule.getNotify_type().equals("4")?" checked":"" %> toolTipText="Provides the capability to attach reports as Excel format to the email."/>Excel Attachment
387 <input type='radio' name='notify' id='notify' value='5' <%= reportSchedule.getNotify_type().equals("5")?" checked":"" %> toolTipText="Provides the capability to attach reports as Excel format to the email."/>Excelx Attachment
389 <input type='radio' name='notify' id='notify' value='3' <%= reportSchedule.getNotify_type().equals("3")?" checked":"" %> toolTipText="Provides the capability to attach reports as CSV format to the email."/>CSV Attachment
390 <%if(!rdefRecurrance.getReportType().equals(AppConstants.RT_HIVE)) {%>
391 <% if(nvl(Globals.getShellScriptDir()).length()>1) { %>
392 <input type='radio' name='notify' id='notify' value='6' <%= reportSchedule.getNotify_type().equals("6")?" checked":"" %> toolTipText="Provides the capability to send only links to the generated report in the email."/>Link to Generated report
395 <input type='hidden' name='notify_type' value='1'/>
400 <td class=rbg2 align="right" width="25%" height="30"><font class=rtabletext>Recurrence: </font></td>
401 <td class=rbg3 align="left" width="50%"><font class=rtabletext>
402 <select name="schedRecurrence" toolTipText="This is used to select recurrence frequency.">
403 <%if (rdefRecurrance.getIsOneTimeScheduleAllowed() == null || rdefRecurrance.getIsOneTimeScheduleAllowed().equals("Y")){ %><option value="" <%= reportSchedule.getRecurrence().equals("" )?" selected":"" %>>One Time<%} %>
404 <%if (rdefRecurrance.getIsHourlyScheduleAllowed() == null || rdefRecurrance.getIsHourlyScheduleAllowed().equals("Y")){ %><option value="<%= AppConstants.SR_HOURLY %>"<%= reportSchedule.getRecurrence().equals(AppConstants.SR_HOURLY )?" selected":"" %>>Hourly<%} %>
405 <%if (rdefRecurrance.getIsDailyScheduleAllowed() == null || rdefRecurrance.getIsDailyScheduleAllowed().equals("Y")){ %><option value="<%= AppConstants.SR_DAILY %>"<%= reportSchedule.getRecurrence().equals(AppConstants.SR_DAILY )?" selected":"" %>>Daily<%} %>
406 <%if (rdefRecurrance.getIsDailyMFScheduleAllowed() == null || rdefRecurrance.getIsDailyMFScheduleAllowed().equals("Y")){ %><option value="<%= AppConstants.SR_DAILY_MO_FR %>"<%= reportSchedule.getRecurrence().equals(AppConstants.SR_DAILY_MO_FR)?" selected":"" %>>Daily Mo-Fr<%} %>
407 <%if (rdefRecurrance.getIsWeeklyScheduleAllowed() == null || rdefRecurrance.getIsWeeklyScheduleAllowed().equals("Y")){ %><option value="<%= AppConstants.SR_WEEKLY %>"<%= reportSchedule.getRecurrence().equals(AppConstants.SR_WEEKLY )?" selected":"" %>>Weekly<%} %>
408 <%if (rdefRecurrance.getIsMonthlyScheduleAllowed() == null || rdefRecurrance.getIsMonthlyScheduleAllowed().equals("Y")){ %><option value="<%= AppConstants.SR_MONTHLY %>"<%= reportSchedule.getRecurrence().equals(AppConstants.SR_MONTHLY )?" selected":"" %>>Monthly<%} %>
413 <td class=rbg2 align="right" width="25%" height="30"><font class=rtabletext>First Schedule Date: </font></td>
414 <td class=rbg3 align="left" width="50%" nowrap><font class=rtabletext>
415 <input type="text" size="10" maxlength="10" name="schedStartDate" value="<%= reportSchedule.getStartDate() %>" toolTipText="Enter the date and time scheduling is to start.">
416 <!--<a href="#" onClick="window.dateField = document.forma.schedStartDate;calendar = window.open('<%= AppUtils.getRaptorActionURL() %>popup.calendar','cal','WIDTH=200,HEIGHT=250');return false;">
417 <img src="<%= AppUtils.getImgFolderURL() %>calender_icon.gif" align=absmiddle border=0 width="20" height="20">
419 <img src="<%= AppUtils.getImgFolderURL() %>calender_icon.gif" align=absmiddle border=0 width="20" height="20" onClick="oCalendar = new CalendarPopup('calendarDiv', 'calendarFrame');oCalendar.addDisabledDates(null, '<%=dtf.format(startCalendarDate.getTime())%>');oCalendar.addDisabledDates('<%=dtf.format(endCalendarDate.getTime())%>', null);oCalendar.setCssPrefix('raptor');oCalendar.select(document.getElementById('schedStartDate'),event,'MM/dd/yyyy'); return false;" style="cursor:hand">
420
421 <select name="schedHour">
422 <option value="01"<%= reportSchedule.getRunHour().equals("01")?" selected":"" %>>1
423 <option value="02"<%= reportSchedule.getRunHour().equals("02")?" selected":"" %>>2
424 <option value="03"<%= reportSchedule.getRunHour().equals("03")?" selected":"" %>>3
425 <option value="04"<%= reportSchedule.getRunHour().equals("04")?" selected":"" %>>4
426 <option value="05"<%= reportSchedule.getRunHour().equals("05")?" selected":"" %>>5
427 <option value="06"<%= reportSchedule.getRunHour().equals("06")?" selected":"" %>>6
428 <option value="07"<%= reportSchedule.getRunHour().equals("07")?" selected":"" %>>7
429 <option value="08"<%= reportSchedule.getRunHour().equals("08")?" selected":"" %>>8
430 <option value="09"<%= reportSchedule.getRunHour().equals("09")?" selected":"" %>>9
431 <option value="10"<%= reportSchedule.getRunHour().equals("10")?" selected":"" %>>10
432 <option value="11"<%= reportSchedule.getRunHour().equals("11")?" selected":"" %>>11
433 <option value="12"<%= reportSchedule.getRunHour().equals("12")?" selected":"" %>>12
435 <select name="schedMin">
436 <option value="00"<%= reportSchedule.getRunMin().equals("00")?" selected":"" %>>00
437 <option value="15"<%= reportSchedule.getRunMin().equals("15")?" selected":"" %>>15
438 <option value="30"<%= reportSchedule.getRunMin().equals("30")?" selected":"" %>>30
439 <option value="45"<%= reportSchedule.getRunMin().equals("45")?" selected":"" %>>45
441 <select name="schedAMPM">
442 <option value="AM"<%= reportSchedule.getRunAMPM().equals("AM")?" selected":"" %>>AM
443 <option value="PM"<%= reportSchedule.getRunAMPM().equals("PM")?" selected":"" %>>PM
445 <%= Globals.getTimeZone()%>
450 <!-- /quick help text -->
452 <td class=rbg2 align="right" width="25%" height="30"><font class=rtabletext>Last Schedule Date: </font></td>
453 <td class=rbg3 align="left" width="50%" nowrap><font class=rtabletext>
454 <input type="text" size="10" maxlength="10" name="schedEndDate" value="<%= reportSchedule.getEndDate() %>" toolTipText="Enter the date scheduling is to end. This is mandatory for recurring reports.">
455 <!--<a href="#" onClick="window.dateField = document.forma.schedEndDate;calendar = window.open('<%= AppUtils.getRaptorActionURL() %>popup.calendar','cal','WIDTH=200,HEIGHT=250');return false;">
456 <img src="<%= AppUtils.getImgFolderURL() %>calender_icon.gif" align=absmiddle border=0 width="20" height="20">
458 <img src="<%= AppUtils.getImgFolderURL() %>calender_icon.gif" align=absmiddle border=0 width="20" height="20" onClick="oCalendar = new CalendarPopup('calendarDiv', 'calendarFrame');oCalendar.addDisabledDates(null, '<%=dtf.format(startCalendarDate.getTime())%>');oCalendar.addDisabledDates('<%=dtf.format(endCalendarDate.getTime())%>', null);oCalendar.setCssPrefix('raptor');oCalendar.select(document.getElementById('schedEndDate'),event,'MM/dd/yyyy'); return false;" style="cursor:hand">
459
460 <select name="schedEndHour">
461 <option value="01"<%= reportSchedule.getEndHour().equals("01")?" selected":"" %>>1
462 <option value="02"<%= reportSchedule.getEndHour().equals("02")?" selected":"" %>>2
463 <option value="03"<%= reportSchedule.getEndHour().equals("03")?" selected":"" %>>3
464 <option value="04"<%= reportSchedule.getEndHour().equals("04")?" selected":"" %>>4
465 <option value="05"<%= reportSchedule.getEndHour().equals("05")?" selected":"" %>>5
466 <option value="06"<%= reportSchedule.getEndHour().equals("06")?" selected":"" %>>6
467 <option value="07"<%= reportSchedule.getEndHour().equals("07")?" selected":"" %>>7
468 <option value="08"<%= reportSchedule.getEndHour().equals("08")?" selected":"" %>>8
469 <option value="09"<%= reportSchedule.getEndHour().equals("09")?" selected":"" %>>9
470 <option value="10"<%= reportSchedule.getEndHour().equals("10")?" selected":"" %>>10
471 <option value="11"<%= reportSchedule.getEndHour().equals("11")?" selected":"" %>>11
472 <option value="12"<%= reportSchedule.getEndHour().equals("12")?" selected":"" %>>12
474 <select name="schedEndMin">
475 <option value="00"<%= reportSchedule.getEndMin().equals("00")?" selected":"" %>>00
476 <option value="15"<%= reportSchedule.getEndMin().equals("15")?" selected":"" %>>15
477 <option value="30"<%= reportSchedule.getEndMin().equals("30")?" selected":"" %>>30
478 <option value="45"<%= reportSchedule.getEndMin().equals("45")?" selected":"" %>>45
480 <select name="schedEndAMPM">
481 <option value="AM"<%= reportSchedule.getEndAMPM().equals("AM")?" selected":"" %>>AM
482 <option value="PM"<%= reportSchedule.getEndAMPM().equals("PM")?" selected":"" %>>PM
484 <%= Globals.getTimeZone()%>
490 <script type="text/javascript">initStartEndDate();</script>
492 <% if(AppUtils.isAdminUser(request) || isSQLAllowed ) { %>
494 <td class=rbg2 align="right" width="25%" height="30"><font class=rtabletext>Use Condition:</font></td>
495 <td class=rbg3 align="left" width="50%" valign="middle" nowrap><font class=rtabletext>
496 <input type="checkbox" name="conditional" value="Y"<%= reportSchedule.getConditional().equals("Y")?" checked":"" %>> Send Emails Only When Condition Is Met
500 <td class=rbg2 align="right" width="25%" height="30"><font class=rtabletext>Condition SQL:</font></td>
501 <td class=rbg3 align="left" width="50%" valign="middle" nowrap>
502 <textarea name="conditionSQL" cols="40" rows="3"><%= nvl(reportSchedule.getConditionSQL()) %></textarea>
503 <input type="Button" class=button value="Test" onClick="showTestConditionPopup()">
510 <td class=rbg2 align="right" width="25%" height="30"><font class=rtabletext>Max rows in attachment:</font></td>
511 <td class=rbg3 align="left" width="50%" valign="middle" nowrap>
512 <input type='text' name='downloadLimit' value="<%=Integer.parseInt(reportSchedule.getDownloadLimit())>0?reportSchedule.getDownloadLimit(): Integer.toString(rdefRecurrance.getMaxRowsInExcelDownload())%>" size='4' toolTipText="Specify the maximum number of rows that can be sent in an attachment."/>
517 <td class=rbg1 colspan="2" align="left">
518 <b class=rtableheader>Form Fields</b>
522 <jsp:include page="wizard_schedule_formfield_include.jsp" flush="true" />
524 <td colspan=4><hr></hr></td>
526 <input type="hidden" name="toListUpdated" value="false" />
528 <% List emailToUsers = reportSchedule.getEmailToUsers();
529 for(int i=0; i<emailToUsers.size(); i++) {
530 IdNameValue userValue = (IdNameValue) emailToUsers.get(i); %>
532 <td class=rbg2 align="right" width="25%" height="30"><font class=rtabletext><%= (i==0)?"Email To: ":" " %></font></td>
533 <td class=rbg3 align="left" width="50%" nowrap><font class=rtabletext>
534 <%= userValue.getName() %>
535
536 <input type=image border="0" src="<%= AppUtils.getImgFolderURL() %>deleteicon.gif" alt="Remove" width="12" height="12" onClick="if(! dataValidate()) {return false;} else if(! confirm('Are you sure?')) {return false;} else {document.forma.<%= AppConstants.RI_WIZARD_ACTION %>.value='<%= AppConstants.WA_DELETE_USER %>'; document.all.toListUpdated.value='true'; document.forma.<%= AppConstants.RI_DETAIL_ID %>.value='<%= userValue.getId() %>'; }">
540 List emailToRoles = reportSchedule.getEmailToRoles();
541 for(int i=0; i<emailToRoles.size(); i++) {
542 IdNameValue roleValue = (IdNameValue) emailToRoles.get(i); %>
544 <td class=rbg2 align="right" width="25%" height="30"><font class=rtabletext><%= (emailToUsers.size()==0&&i==0)?"Email To: ":" " %></font></td>
545 <td class=rbg3 align="left" width="50%" nowrap><font class=rtabletext>Everyone With Role:
546 <%= roleValue.getName() %>
547
548 <input type=image border="0" src="<%= AppUtils.getImgFolderURL() %>deleteicon.gif" alt="Remove" width="12" height="12" onClick="if(! dataValidate()) {return false;} else if(! confirm('Are you sure?')) {return false;} else {document.forma.<%= AppConstants.RI_WIZARD_ACTION %>.value='<%= AppConstants.WA_DELETE_ROLE %>'; document.all.toListUpdated.value='true'; document.forma.<%= AppConstants.RI_DETAIL_ID %>.value='<%= roleValue.getId() %>'; }">
553 Vector remainingUsers = Utils.getUsersNotInList(emailToUsers,request);
554 Vector remainingRoles = Utils.getRolesNotInList(emailToRoles,request);
555 if((emailToUsers.size()+emailToRoles.size()==0)||(remainingUsers.size()>0)||(remainingRoles.size()>0)) { %>
557 <td colspan="2" align="center">
558 <table width="100%" cellspacing="1" cellpadding="3" align="center" border="0"> <tr>
559 <td class=rbg2 align="right" width="25%" height="30"><font class=rtabletext><%= (emailToUsers.size()+emailToRoles.size()==0)?"Email To: ":" " %></font></td>
560 <td class=rbg3 align="left" width="50%" nowrap><font class=rtabletext>
561 <% if(remainingUsers.size()>0) { %>
562 <select name="schedEmailAdd" onChange="if(! dataValidate()) {selectedIndex=0;} else {document.forma.<%= AppConstants.RI_WIZARD_ACTION %>.value='<%= AppConstants.WA_ADD_USER %>'; document.all.toListUpdated.value='true'; document.forma.submit();}" toolTipText="Select users and/or roles the report should be sent to">
563 <option value="" selected>--- Select User ---
564 <% for(int i=0; i<remainingUsers.size(); i++) {
565 IdNameValue userValue = (IdNameValue) remainingUsers.get(i); %>
566 <option value="<%= userValue.getId() %>"><%= userValue.getName() %>
570 No user emails available
572
573 <% if(remainingRoles.size()>0) { %>
574 <select name="schedEmailAddRole" onChange="if(! dataValidate()) {selectedIndex=0;} else {document.forma.<%= AppConstants.RI_WIZARD_ACTION %>.value='<%= AppConstants.WA_ADD_ROLE %>'; document.all.toListUpdated.value='true'; document.forma.submit();}" toolTipText="Select users and/or roles the report should be sent to">
575 <option value="" selected>--- Select Role ---
576 <% for(int i=0; i<remainingRoles.size(); i++) {
577 IdNameValue roleValue = (IdNameValue) remainingRoles.get(i); %>
578 <option value="<%= roleValue.getId() %>"><%= roleValue.getName() %>
586 <% if ( nvl(Globals.getEncryptedSMTPServer(),"").length() > 0 ) { %>
587 <td align="right" width="27%"><font class=rtabletext>Encrypt Attachment</font>
588 <input type='radio' name='encryptMode' id='encryptMode' value='Y' <%= reportSchedule.getEncryptMode().equals("Y")?"":" checked" %> toolTipText="Choose the encryption mode."/>Yes
590 <input type='radio' name='encryptMode' id='encryptMode' value='N' <%= reportSchedule.getEncryptMode().equals("N")?"":(reportSchedule.getEncryptMode().length()<=0)?" checked":(!reportSchedule.getEncryptMode().equals("N"))? " " :" checked " %> toolTipText="Choose the encryption mode."/>No
593 <% if (Globals.generateSchedReportsInFileSystem()) { %>
594 <td align="right" width="27%"><font class=rtabletext>Send as Attachment</font>
595 <input type='radio' name='sendAttachment' id='sendAttachment' value='Y' <%= reportSchedule.isAttachmentMode()?" checked ":""%> toolTipText="Send As Attachment"/>Yes
597 <input type='radio' name='sendAttachment' id='sendAttachment' value='N' <%= !reportSchedule.isAttachmentMode()?" checked":"" %> toolTipText="Store it in file system."/>No
611 <script language="JavaScript">
613 function dataValidate() {
614 //alert("dataValidate called");
615 var startDate = new Date(document.forma.schedStartDate.value);
616 var startHour = eval(document.forma.schedHour.value);
617 if(document.forma.schedAMPM.value == 'PM') {
618 if (startHour != 12) startHour = startHour + 12;
620 if (startHour == 12) startHour = startHour - 12;
622 startDate.setHours(startHour);
623 startDate.setMinutes(eval(document.forma.schedMin.value));
625 var endDate = new Date(document.forma.schedEndDate.value);
626 var endHour = eval(document.forma.schedEndHour.value);
627 if(document.forma.schedEndAMPM.value == 'PM') {
628 if (endHour != 12) endHour = endHour + 12;
630 if (endHour == 12) endHour = endHour - 12;
632 endDate.setHours(endHour);
633 endDate.setMinutes(eval(document.forma.schedEndMin.value));
635 //alert ("System Calendar " + "<%=systemCalendar.get(Calendar.YEAR)+ " " + (systemCalendar.get(Calendar.MONTH)+1)+ " " + systemCalendar.get(Calendar.DAY_OF_MONTH) + " " + systemCalendar.get(Calendar.HOUR_OF_DAY) + " " + systemCalendar.get(Calendar.MINUTE) + " " + systemCalendar.get(Calendar.SECOND)%>");
636 var currDate = new Date();
637 var curr1Date = new Date();
638 currDate.setFullYear(<%=systemCalendar.get(Calendar.YEAR)%>, <%=systemCalendar.get(Calendar.MONTH)%>,<%=systemCalendar.get(Calendar.DAY_OF_MONTH)%>);
639 currDate.setHours(<%=systemCalendar.get(Calendar.HOUR_OF_DAY)%>);
640 currDate.setMinutes(<%=systemCalendar.get(Calendar.MINUTE)%>);
641 currDate.setSeconds(<%=systemCalendar.get(Calendar.SECOND)%>);
643 //alert(startDate+ " " + currDate + " " + (startDate-currDate) + " " + (startDate.toString()==currDate.toString()));
646 if(! checkDate(document.forma.schedStartDate.value, false)) {
647 alert("Invalid Start Date. The date format should be MM/DD/YYYY");
648 document.forma.schedStartDate.focus();
649 document.forma.schedStartDate.select();
652 if(! checkDate(document.forma.schedEndDate.value, false)) {
653 alert("Invalid End Date. The date format should be MM/DD/YYYY");
654 document.forma.schedEndDate.focus();
655 document.forma.schedEndDate.select();
658 if (startDate >= endDate){
659 alert("Start Date has to be less than the End Date.");
663 if (startDate - currDate < 0){
664 if(startDate.toString()!=currDate.toString()) {
665 var m_names = new Array("January", "February", "March",
666 "April", "May", "June", "July", "August", "September",
667 "October", "November", "December");
668 var curr_min = currDate.getMinutes();
669 curr_min = curr_min + "";
670 if (curr_min.length == 1) {
671 curr_min = "0" + curr_min;
673 alert("Start Date/Time has to be greater or equal to the System Date/Time ("+m_names[currDate.getMonth()]+" "+ currDate.getDate() + ", " + currDate.getYear() + " " + currDate.getHours()+ ":" + curr_min+ ").");
677 /*if(! checkDate(document.forma.schedRunDate.value, true)) {
678 alert("Invalid Execution Date. The date format should be MM/DD/YYYY");
679 document.forma.schedRunDate.focus();
680 document.forma.schedRunDate.select();
683 <% if (AppUtils.isAdminUser(request) || isSQLAllowed){ %>
684 if(document.forma.conditional.checked&&document.forma.conditionSQL.value=="") {
685 alert("Please provide Condition SQL");
686 document.forma.conditionSQL.focus();
687 document.forma.conditionSQL.select();
691 if(! checkNonNegativeInteger(document.forma.downloadLimit.value)) {
692 alert("Max row in attachment is not a valid integer.\nPlease enter a valid value.");
693 document.forma.downloadLimit.focus();
694 document.forma.downloadLimit.select();
699 if((document.forma.downloadLimit.value) > <%=Globals.getDownloadLimit()%>) {
700 alert("Max row you can download should not be more than <%=Globals.getDownloadLimit()%> rows.\nPlease enter a valid value.");
701 document.forma.downloadLimit.focus();
702 document.forma.downloadLimit.select();
707 for (var i=0; i < document.forma.notify.length; i++) {
708 if (document.forma.notify[i].checked) {
709 document.forma.notify_type.value = document.forma.notify[i].value;
712 return validateForm();
719 <script type="text/javascript">
720 var tooltipObj = new DHTMLgoodies_formTooltip();
721 tooltipObj.setTooltipPosition('right');
722 tooltipObj.setPageBgColor('#EEEEEE');
723 //tooltipObj.setPageBgColor('#FFFFFF');
724 tooltipObj.setTooltipCornerSize(15);
725 tooltipObj.setTooltipBgColor("#99CCFF");
726 tooltipObj.initFormFieldTooltip();
731 private String nvl(String s) { return (s==null)?"":s; }
732 private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; }