[Ils-source] r1628 - in branches/1.6: . src/com/resolutions/ils/data src/com/resolutions/jobs webapp webapp/WEB-INF/classes webapp/WEB-INF/lib
scribe at crosswire.org
scribe at crosswire.org
Wed Jan 9 10:57:51 MST 2019
Author: scribe
Date: 2019-01-09 10:57:51 -0700 (Wed, 09 Jan 2019)
New Revision: 1628
Modified:
branches/1.6/
branches/1.6/build.xml
branches/1.6/src/com/resolutions/ils/data/CourseAttempt.java
branches/1.6/src/com/resolutions/ils/data/UserProfile.java
branches/1.6/src/com/resolutions/jobs/MgrComplianceEMails.java
branches/1.6/webapp/WEB-INF/classes/versions.properties
branches/1.6/webapp/WEB-INF/lib/crosswire.jar
branches/1.6/webapp/WEB-INF/lib/ils.jar
branches/1.6/webapp/admin_profile.jsp
branches/1.6/webapp/admin_systemmanagement.jsp
Log:
Merged and committed final changes for release: 1.85.0
Property changes on: branches/1.6
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk:796-1502,1504-1505,1507,1509-1510,1512,1514-1515,1517-1563,1565,1567,1569-1608,1610,1613-1614,1619
+ /trunk:796-1502,1504-1505,1507,1509-1510,1512,1514-1515,1517-1563,1565,1567,1569-1608,1610,1613-1614,1619,1621-1627
Modified: branches/1.6/build.xml
===================================================================
--- branches/1.6/build.xml 2019-01-09 17:52:45 UTC (rev 1627)
+++ branches/1.6/build.xml 2019-01-09 17:57:51 UTC (rev 1628)
@@ -61,6 +61,7 @@
<javadoc sourcepath="${src}" packagenames="*" destdir="${javadoc}"
classpathref="classpath"
private="true">
+<!--
<doclet name="org.umlgraph.doclet.UmlGraphDoc" path="${lib}/UmlGraph.jar">
<param name="-inferrel"/>
<param name="-inferdep"/>
@@ -73,6 +74,7 @@
<param name="-link" value="http://java.sun.com/j2se/1.5.0/docs/guide/javadoc/doclet/spec"/>
<param name="-link" value="http://java.sun.com/j2se/1.5/docs/api"/>
</doclet>
+-->
</javadoc>
</target>
</project>
Modified: branches/1.6/src/com/resolutions/ils/data/CourseAttempt.java
===================================================================
--- branches/1.6/src/com/resolutions/ils/data/CourseAttempt.java 2019-01-09 17:52:45 UTC (rev 1627)
+++ branches/1.6/src/com/resolutions/ils/data/CourseAttempt.java 2019-01-09 17:57:51 UTC (rev 1628)
@@ -90,11 +90,11 @@
" AND CA2.CASTATUSID=1" +
" AND CA2.CAEXPIREDON IS NULL" +
" AND CC.COURSPASSEXPDAYS > 0" +
- " AND CA2.CACOMPLETEDATE <= (current_timestamp - (CC.COURSPASSEXPDAYS - COALESCE(CC.COURSREASBEFDAYS,0)))";
+ " AND DATEDIFF(day, CA2.CACOMPLETEDATE, {CURRENT_TIMESTAMP}) >= (CC.COURSPASSEXPDAYS - COALESCE(CC.COURSREASBEFDAYS,0))";
static String LOOKUPEXPCOURSE = LOOKUPEXP + " AND CA2.COURSID={COURSID}";
- static String REVOKE = "UPDATE COURSEATTEMPT SET CAEXPIREDON=current_timestamp, CAEXPREASON='Recurrent Training Assigned'";
+ static String REVOKE = "UPDATE COURSEATTEMPT SET CAEXPIREDON={CURRENT_TIMESTAMP}, CAEXPREASON='Recurrent Training Assigned'";
static String REVOKEEXPCOURSE = REVOKE + " WHERE COURSATTID IN (" + LOOKUPEXPCOURSE + ")";
static String REVOKEEXP = REVOKE + " WHERE COURSATTID IN (" + LOOKUPEXP + ")";
@@ -107,7 +107,7 @@
" AND CA2.CASTATUSID=1" +
" AND CA2.CAEXPIREDON IS NOT NULL" +
" AND CC.COURSPASSEXPDAYS > 0" +
- " AND CA2.CACOMPLETEDATE <= (current_timestamp - (CC.COURSPASSEXPDAYS - {WARNDAYS}))";
+ " AND DATEDIFF(day, CA2.CACOMPLETEDATE, {CURRENT_TIMESTAMP}) >= (CC.COURSPASSEXPDAYS - {WARNDAYS})";
static String LOOKUPPENDINGEXPCOURSE = LOOKUPPENDINGEXP + " AND CA2.COURSID={COURSID}";
@@ -163,6 +163,7 @@
Properties sysConfig = Utils.getSysConfig(context, companyID);
CourseAttempt query = new CourseAttempt();
query.setCompanyID(companyID);
+ query.setTSValue("CURRENT_TIMESTAMP", Utils.getNow());
List<CourseAttempt> results = null;
int count = 0;
Course course = null;
@@ -240,10 +241,11 @@
* @return
*/
static public synchronized int warnAllPendingExpired(int companyID, int courseID, ServletContext context, int warningNumber) {
+logger.debug("Begin warnAllPendingExpired(companyID: " + companyID + ", courseID: " + courseID + "; warningNumber: " + warningNumber);
Properties sysConfig = Utils.getSysConfig(context, companyID);
CourseAttempt query = new CourseAttempt();
query.setCompanyID(companyID);
- String WARN = "UPDATE COURSEATTEMPT SET CAWARNEDON"+warningNumber+"=current_timestamp";
+ String WARN = "UPDATE COURSEATTEMPT SET CAWARNEDON"+warningNumber+"={CURRENT_TIMESTAMP}";
List<CourseAttempt> results = null;
int count = 0;
@@ -251,14 +253,19 @@
switch (warningNumber) {
case 1:
try { warnDays = Integer.parseInt(sysConfig.getProperty("EmailBeforeDueDate1", "0")); } catch (Exception e) { e.printStackTrace(); }
+ break;
case 2:
try { warnDays = Integer.parseInt(sysConfig.getProperty("EmailBeforeDueDate2", "0")); } catch (Exception e) { e.printStackTrace(); }
+ break;
case 3:
- try { warnDays = Integer.parseInt(sysConfig.getProperty("EmailPastDueDate1", "0")); } catch (Exception e) { e.printStackTrace(); }
+ try { warnDays = -1 * Integer.parseInt(sysConfig.getProperty("EmailPastDueDate1", "0")); } catch (Exception e) { e.printStackTrace(); }
+ break;
case 4:
- try { warnDays = Integer.parseInt(sysConfig.getProperty("EmailPastDueDate2", "0")); } catch (Exception e) { e.printStackTrace(); }
+ try { warnDays = -1 * Integer.parseInt(sysConfig.getProperty("EmailPastDueDate2", "0")); } catch (Exception e) { e.printStackTrace(); }
+ break;
}
query.setIntValue("WARNDAYS", warnDays);
+ query.setTSValue("CURRENT_TIMESTAMP", Utils.getNow());
if (courseID > 0) {
query.setCourseAttemptCourseID(courseID);
@@ -283,7 +290,7 @@
try {
HashMap<String, Object> params = new HashMap<String, Object>();
params.put("SITEURL", sysConfig.getProperty("SiteURL", "your training site"));
- params.put("WARNDAYS", Integer.toString(warnDays));
+ params.put("WARNDAYS", Integer.toString(Math.abs(warnDays)));
params.putAll(ca.getData());
String subject = Utils.replaceParams(subjectTemplate, params);
String body = Utils.replaceParams(bodyTemplate, params);
@@ -296,6 +303,7 @@
}
SMTPMail.closeMailConnection();
}
+logger.debug("End warnAllPendingExpired(companyID: " + companyID + ", courseID: " + courseID + "; warningNumber: " + warningNumber + ") : " + count);
return count;
}
@@ -717,7 +725,7 @@
}
public void setCourseAttemptExpired(String reason) {
- setTSValue("CAEXPIREDON", new Date());
+ setTSValue("CAEXPIREDON", Utils.getNow());
setValue("CAEXPREASON", reason);
}
@@ -734,7 +742,7 @@
}
public void setCourseAttemptForcePass(String reason) {
- Date now = new Date();
+ Date now = Utils.getNow();
setTSValue("CAFORCEPASSON", now);
if (getCourseAttemptCompleteDate() == null) {
setCourseAttemptCompleteDate(now);
@@ -766,7 +774,7 @@
public void defaultAll() {
setCourseAttemptScore(-1);
- setCourseAttemptStartDate(new Date());
+ setCourseAttemptStartDate(Utils.getNow());
setCourseAttemptStatusID(STATUS_IN_PROGRESS);
}
Modified: branches/1.6/src/com/resolutions/ils/data/UserProfile.java
===================================================================
--- branches/1.6/src/com/resolutions/ils/data/UserProfile.java 2019-01-09 17:52:45 UTC (rev 1627)
+++ branches/1.6/src/com/resolutions/ils/data/UserProfile.java 2019-01-09 17:57:51 UTC (rev 1628)
@@ -28,7 +28,8 @@
import com.resolutions.ils.ILSSession;
import com.resolutions.ils.ILSDataObject;
-import com.resolutions.ils.Utils;
+import org.crosswire.utils.Utils;
+import org.crosswire.utils.SMTPMail;
import java.util.HashMap;
import java.io.StringWriter;
import org.owasp.html.HtmlPolicyBuilder;
@@ -89,14 +90,14 @@
+ " UP.USERPRLNAME, UP.USERPRFNAME, UP.USERPRNUM, "
+ " (SELECT MAX(GROUPNAME) FROM USERGROUP UG JOIN ILSGROUP IG ON UG.ILSGROUPID=IG.ILSGROUPID AND UG.USERPRID=UP.USERPRID AND GROUPTYPEID=2) WORKGROUP,"
+ " (SELECT MAX(GROUPNAME) FROM USERGROUP UG JOIN ILSGROUP IG ON UG.ILSGROUPID=IG.ILSGROUPID AND UG.USERPRID=UP.USERPRID AND GROUPTYPEID=1) ROLE, "
- + " C.COURSNAME, CA.CACOMPLETEDATE, CASE C.COURSPASSEXPDAYS WHEN 0 THEN CA.CAEXPIREDON ELSE COALESCE(CA.CAEXPIREDON, CA.CACOMPLETEDATE+C.COURSPASSEXPDAYS) END AS CAEXPIREDON, DATEDIFF(day, CA.CAEXPIREDON, CURRENT_TIMESTAMP) as DAYSEXPIRED, CASE C.COURSPASSEXPDAYS WHEN 0 THEN NULL ELSE C.COURSPASSEXPDAYS - DATEDIFF(day, CA.CACOMPLETEDATE, CURRENT_TIMESTAMP) END as DAYSSHOULDEXPIRE "
+ + " C.COURSNAME, CA.CACOMPLETEDATE, CASE C.COURSPASSEXPDAYS WHEN 0 THEN CA.CAEXPIREDON ELSE COALESCE(CA.CAEXPIREDON, CA.CACOMPLETEDATE+C.COURSPASSEXPDAYS) END AS CAEXPIREDON, DATEDIFF(day, CA.CAEXPIREDON, {CURRENT_TIMESTAMP}) as DAYSEXPIRED, CASE C.COURSPASSEXPDAYS WHEN 0 THEN NULL ELSE C.COURSPASSEXPDAYS - DATEDIFF(day, CA.CACOMPLETEDATE, {CURRENT_TIMESTAMP}) END as DAYSSHOULDEXPIRE "
+ " FROM USERCOURSEASSIGNMENTSWITHGROUPS CASS "
+ " LEFT JOIN COURSE C ON C.COURSID = CASS.COURSID "
+ " LEFT JOIN COURSE CURDET ON CURDET.COURSID = CASS.FROMCURRICULUM "
+ " LEFT JOIN COURSEATTEMPT CA ON CA.USERPRID=CASS.USERPRID AND CA.COURSID=CASS.COURSID "
+ " INNER JOIN (SELECT USERPRID, COURSID, MAX(CACOMPLETEDATE) as max_date FROM COURSEATTEMPT GROUP BY USERPRID, COURSID)a on a.USERPRID = CA.USERPRID AND a.COURSID=CA.COURSID and a.max_date = CA.CACOMPLETEDATE "
+ " LEFT JOIN USERPROFILE UP ON UP.COMPANYID=CASS.COMPANYID AND UP.USERPRID = CASS.USERPRID "
- + " WHERE CASS.COMPANYID={COMPANYID} AND (DATEDIFF(day, CA.CAEXPIREDON, CURRENT_TIMESTAMP) >= 0 OR CASE C.COURSPASSEXPDAYS WHEN 0 THEN NULL ELSE C.COURSPASSEXPDAYS - DATEDIFF(day, CA.CACOMPLETEDATE, CURRENT_TIMESTAMP) END <={DAYSTILEXP}) AND UP.USERPRSTATUSID=" + STATUS_ACTIVE
+ + " WHERE CASS.COMPANYID={COMPANYID} AND (DATEDIFF(day, CA.CAEXPIREDON, {CURRENT_TIMESTAMP}) >= 0 OR CASE C.COURSPASSEXPDAYS WHEN 0 THEN NULL ELSE C.COURSPASSEXPDAYS - DATEDIFF(day, CA.CACOMPLETEDATE, {CURRENT_TIMESTAMP}) END <={DAYSTILEXP}) AND UP.USERPRSTATUSID=" + STATUS_ACTIVE
+ " AND (CURDET.COURSISCURRICCERT IS NULL OR CURDET.COURSISCURRICCERT = 'F')"
+ "";
static String RECURRENT_TRAINING_REPORT_LIMIT_TO_MANAGER = " AND CASS.USERPRID IN (SELECT DISTINCT UG.USERPRID FROM MANAGERGROUP MG LEFT JOIN USERGROUP UG ON UG.COMPANYID = MG.COMPANYID AND UG.ILSGROUPID=MG.ILSGROUPID WHERE MG.COMPANYID={COMPANYID} AND MG.USERPRID={USERPRID}) AND (GROUPTYPEID <> 2 OR ILSGROUPID IN (SELECT ILSGROUPID FROM MANAGERGROUP WHERE COMPANYID={COMPANYID} AND USERPRID={USERPRID}))";
@@ -158,14 +159,14 @@
static public int deleteExpiredUserProfiles(ILSSession session, int olderThanDays) {
Calendar cal = Calendar.getInstance();
- cal.setTime(new Date());
+ cal.setTime(Utils.getNow());
cal.add(Calendar.DAY_OF_YEAR, olderThanDays*-1);
return deleteExpiredUserProfiles(session, cal.getTime());
}
static public int getCountOfExpiredUserProfiles(ILSSession session, int olderThanDays) {
Calendar cal = Calendar.getInstance();
- cal.setTime(new Date());
+ cal.setTime(Utils.getNow());
cal.add(Calendar.DAY_OF_YEAR, olderThanDays*-1);
return getCountOfExpiredUserProfiles(session, cal.getTime());
}
@@ -227,7 +228,7 @@
subject = Utils.replaceParams(subject, params);
body = Utils.replaceParams(body, params);
body += Utils.getSysConfig(email).getProperty("SendMailSig", "");
- Utils.sendEmail(email, Utils.getSysConfig(email).getProperty("SendMailFrom"), getUserProfileEMail(), subject, body, false);
+ SMTPMail.sendEmail(email, Utils.getSysConfig(email).getProperty("SendMailFrom"), getUserProfileEMail(), subject, body, false);
}
catch (Exception e) {
e.printStackTrace();
@@ -278,7 +279,7 @@
subject = Utils.replaceParams(subject, params);
body = Utils.replaceParams(body, params);
body += sysConfig.getProperty("SendMailSig", "");
- Utils.sendEmail(email, sysConfig.getProperty("SendMailFrom"), retVal.getUserProfileEMail(), subject, body, false);
+ SMTPMail.sendEmail(email, sysConfig.getProperty("SendMailFrom"), retVal.getUserProfileEMail(), subject, body, false);
}
}
catch (Exception e) {
@@ -585,6 +586,7 @@
UserProfile retVal = new UserProfile();
String sql = RECURRENT_TRAINING_REPORT;
retVal.setCompanyID(companyID);
+ retVal.setTSValue("CURRENT_TIMESTAMP", Utils.getNow());
retVal.setIntValue("DAYSTILEXP", daysTilExpire);
if (limitToManagerID != -1) {
sql += RECURRENT_TRAINING_REPORT_LIMIT_TO_MANAGER;
@@ -612,6 +614,7 @@
return getStringValue("USERPRNUM");
}
+ //TODO: this method should not exist
public String getUserProfilePasswd() {
return getStringValue("USERPRPASSWD");
}
@@ -697,7 +700,7 @@
Calendar cal = Calendar.getInstance();
cal.setTime(getUserProfileHireDate());
cal.add(Calendar.DAY_OF_YEAR, days);
- return cal.getTime().getTime() < new Date().getTime();
+ return cal.getTime().getTime() < Utils.getNowMillis();
}
public Date getUserProfileTermDate() {
@@ -781,7 +784,8 @@
}
public void setUserProfilePasswd(String userProfilePasswd) {
- setValue("USERPRPASSWD", userProfilePasswd);
+ // bypass OWASP XSS sanitation; we never include passwd as part of html
+ super.setValue("USERPRPASSWD", userProfilePasswd);
}
public void setUserProfileState(String userProfileState) {
@@ -823,7 +827,7 @@
public void setUserProfileStatusID(int userProfileStatusID) {
setIntValue("USERPRSTATUSID", userProfileStatusID);
if (userProfileStatusID == UserProfile.STATUS_INACTIVE) {
- setUserProfileInactiveDate(new Date());
+ setUserProfileInactiveDate(Utils.getNow());
}
}
@@ -1037,13 +1041,13 @@
body = Utils.replaceParams(body, params);
body += Utils.getSysConfig(httpSession).getProperty("SendMailSig", "");
try {
- Utils.sendEmail(httpSession, Utils.getSysConfig(httpSession).getProperty("SendMailFrom"), email, subject, body, true);
+ SMTPMail.sendEmail(httpSession, Utils.getSysConfig(httpSession).getProperty("SendMailFrom"), email, subject, body, true);
} catch (Exception e) {
e.printStackTrace();
}
}
}
- Utils.closeMailConnection();
+ SMTPMail.closeMailConnection();
return results.size();
}
@@ -1099,7 +1103,7 @@
String companyName = Company.getCompany(getCompanyID()).getCompanyName();
out.write(companyName + "\n");
out.write(getUserProfileFirstName() + " " + getUserProfileLastName() + "\n");
- out.write("Report Run " + df.format(new Date()) + "\n\n");
+ out.write("Report Run " + df.format(Utils.getNow()) + "\n\n");
out.write("Compliance Report\n\n");
out.write(getGroupComplReport(getCompanyID(), groupID).toString());
Properties sysConfig = Utils.getSysConfig(context, getCompanyID());
@@ -1121,7 +1125,7 @@
catch (Exception e) {
e.printStackTrace();
}
- Utils.closeMailConnection();
+ SMTPMail.closeMailConnection();
}
@@ -1148,7 +1152,7 @@
String companyName = Company.getCompany(getCompanyID()).getCompanyName();
out.write(companyName + "\n");
out.write(getUserProfileFirstName() + " " + getUserProfileLastName() + "\n");
- out.write("Report Run " + df.format(new Date()) + "\n\n");
+ out.write("Report Run " + df.format(Utils.getNow()) + "\n\n");
out.write("Recurrent Training Management Report\n\n");
out.write("Past Due Training\n\n");
out.write("Last Name,");
@@ -1216,7 +1220,7 @@
catch (Exception e) {
e.printStackTrace();
}
- Utils.closeMailConnection();
+ SMTPMail.closeMailConnection();
}
public String toXML() {
Modified: branches/1.6/src/com/resolutions/jobs/MgrComplianceEMails.java
===================================================================
--- branches/1.6/src/com/resolutions/jobs/MgrComplianceEMails.java 2019-01-09 17:52:45 UTC (rev 1627)
+++ branches/1.6/src/com/resolutions/jobs/MgrComplianceEMails.java 2019-01-09 17:57:51 UTC (rev 1628)
@@ -17,7 +17,7 @@
import org.apache.log4j.Logger;
-import com.resolutions.ils.Utils;
+import org.crosswire.utils.Utils;
import com.resolutions.ils.data.Company;
import com.resolutions.ils.data.Group;
import com.resolutions.ils.data.UserProfile;
@@ -71,15 +71,15 @@
else {
cal.add(Calendar.DAY_OF_MONTH, 1);
}
- cal.add(Calendar.HOUR, -4); // be sure we don't miss out date by just a few hours. report shouldn't take more than this long to run the reports.
-logger.debug("LastBatchRun: " + lastDate + "; Next Batch Run After: " + cal.getTime() + "; Now: " + new Date());
+ cal.add(Calendar.HOUR, -4); // be sure we don't miss our date by just a few hours. report shouldn't take more than this long to run the reports.
+logger.debug("LastBatchRun: " + lastDate + "; Next Batch Run After: " + cal.getTime() + "; Now: " + Utils.getNow());
lastDate = cal.getTime();
- if (new Date().after(lastDate)) {
+ if (Utils.getNow().after(lastDate)) {
logger.debug("running...");
UserProfile.runMgrComplReport(servletContext, complReportThresholdPercent, complReportManagersOlderThanNumDays);
- lastJobs.setProperty("LastBatchRun", df.format(new Date()));
+ lastJobs.setProperty("LastBatchRun", df.format(Utils.getNow()));
try {
FileOutputStream propFile = new FileOutputStream(propName);
lastJobs.store(propFile, "last saved from MgrComplEmail batch job");
Modified: branches/1.6/webapp/WEB-INF/classes/versions.properties
===================================================================
--- branches/1.6/webapp/WEB-INF/classes/versions.properties 2019-01-09 17:52:45 UTC (rev 1627)
+++ branches/1.6/webapp/WEB-INF/classes/versions.properties 2019-01-09 17:57:51 UTC (rev 1628)
@@ -1 +1 @@
-LMS=V1.82.1
+LMS=V1.85.0
Modified: branches/1.6/webapp/WEB-INF/lib/crosswire.jar
===================================================================
(Binary files differ)
Modified: branches/1.6/webapp/WEB-INF/lib/ils.jar
===================================================================
(Binary files differ)
Modified: branches/1.6/webapp/admin_profile.jsp
===================================================================
--- branches/1.6/webapp/admin_profile.jsp 2019-01-09 17:52:45 UTC (rev 1627)
+++ branches/1.6/webapp/admin_profile.jsp 2019-01-09 17:57:51 UTC (rev 1628)
@@ -581,12 +581,10 @@
<td width="228"><input <%=(editMisc)?"":"disabled=\"true\""%> name="mgrRecOver" value="true" type="checkbox" <%=current.isMgrRecurEmailOverride()?"checked=\"checked\"":""%> /></td>
</tr>
-<!--
<tr>
<td valign="middle" class="formHeadings">Override (Disable) Manager Compliance Report Emails: </td>
<td width="228"><input <%=(editMisc)?"":"disabled=\"true\""%> name="mgrComOver" value="true" type="checkbox" <%=current.isMgrComplEmailOverride()?"checked=\"checked\"":""%> /></td>
</tr>
--->
<tr>
<td valign="middle" class="formHeadings"><span style="color:red;">* </span><t:t>Role</t:t>: </td>
Modified: branches/1.6/webapp/admin_systemmanagement.jsp
===================================================================
--- branches/1.6/webapp/admin_systemmanagement.jsp 2019-01-09 17:52:45 UTC (rev 1627)
+++ branches/1.6/webapp/admin_systemmanagement.jsp 2019-01-09 17:57:51 UTC (rev 1628)
@@ -4,8 +4,9 @@
contentType="text/html;charset=utf-8"
%>
<%@ page trimDirectiveWhitespaces="true" %>
-<%@ page import="com.resolutions.ils.*" %>
+<%@ page import="org.crosswire.utils.Utils" %>
<%@ page import="com.resolutions.ils.data.*" %>
+<%@ page import="com.resolutions.ils.ILSSession" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Comparator" %>
@@ -21,6 +22,11 @@
<%@ page import="org.apache.commons.fileupload.*" %>
<%@ page import="org.apache.commons.lang.StringEscapeUtils" %>
<%@ page import="org.apache.log4j.Logger" %>
+<%@ page import="org.quartz.Scheduler" %>
+<%@ page import="org.quartz.JobKey" %>
+<%@ page import="org.quartz.Trigger" %>
+<%@ page import="org.quartz.impl.StdSchedulerFactory" %>
+<%@ page import="org.quartz.impl.matchers.GroupMatcher" %>
<%
Logger logger = Logger.getLogger(this.getClass());
@@ -110,12 +116,10 @@
emailTemplates.add(new EMailTemplate("Recurrent Training Report", "Your Employee's Past Due & Upcoming Training",
"The attached Recurrent Training Report includes the Past Due & Upcoming Recurrent Training for your employees at {CONAME}."
));
-/*
// 8
emailTemplates.add(new EMailTemplate("Manager Compliance Report", "Your Teams' Compliance",
"The attached Team Compliance Report includes the compliance rates for your employees at {CONAME}."
));
-*/
Properties sysConfigProperties = Utils.getSysConfig(session);
File sysConfigFile = new File(session.getServletContext().getRealPath("/WEB-INF/sysconfig."+ilsSession.getCompanyID()+".properties"));
@@ -195,7 +199,7 @@
String validError = "";
Company current = null;
- SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy");
+ SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss z");
try {
current = Company.getCompany(ilsSession);
@@ -479,6 +483,27 @@
statusMsg = "Sent Manager Compliance Emails.";
logger.debug("Finished Sending Manager Compliance Emails");
}
+ if ("runJob".equals(action)) {
+ String jobGroup = request.getParameter("jobGroup");
+ String jobName = request.getParameter("jobName");
+ JobKey jobKey = JobKey.jobKey(jobName, jobGroup);
+ Scheduler scheduler = new StdSchedulerFactory().getScheduler();
+ try {
+ scheduler.triggerJob(jobKey);
+ statusMsg = "Launching Job: " + jobName + ".";
+ }
+ catch (Exception e) {
+ statusMsg = "Problem Launching Job: " + jobName + ".";
+ }
+ }
+ if ("setTime".equals(action)) {
+ String stagedTime = request.getParameter("stagedTime");
+ Utils.setNow(df.parse(stagedTime).getTime());
+ statusMsg = "Setting Job Stage Time to: " + Utils.getNow();
+ }
+ if ("clearTime".equals(action)) {
+ Utils.setNow(null);
+ }
if ("Save".equals(action)) {
boolean saveLog = false;
@@ -1149,7 +1174,7 @@
<span class="instructiontxt"><%= statusMsg %></span><br/>
<span class="instructiontxt"><%= validError %></span>
</div>
-<form autocomplete="false" id="systemsave" method="post" action="admin_systemmanagement.jsp" enctype="multipart/form-data">
+<form autocomplete="off" id="systemsave" method="post" action="admin_systemmanagement.jsp" enctype="multipart/form-data">
<table cellpadding="0" id="tableForm" class="tableForm">
<tr>
<th>Edit System Settings</th>
@@ -1160,7 +1185,7 @@
<table id="tableFormData" class="tableFormData">
<tr>
<td class="formHeadings">Version :</td>
- <td colspan="2"><%=Utils.getVersionString()%></td>
+ <td colspan="2"><%=com.resolutions.ils.Utils.getVersionString()%></td>
</tr>
<tr>
<td class="formHeadings">Company ID :</td>
@@ -1258,17 +1283,17 @@
<tr>
<td class="formHeadings">Outgoing Mail User: </td>
<td colspan="2">
-<!-- the following two hidden fields are to try to prevent chrome from autofilling empty web server login fields with user's standard username and password. Stupid Chrome doesn't obey autocompete="false"
+<!-- the following two hidden fields are to try to prevent chrome from autofilling empty web server login fields with user's standard username and password. Stupid Chrome doesn't obey autocompete="off"
these two fields get autofilled instead and are always ignored
-->
<input name="prevent_autofill" type="text" value="" style="display:none;" />
<input name="prevent_autofill_password" type="password" value="" style="display:none;" />
<!-- end of stupid 2 dummy field workaround for Chrome -->
-<input name="sendMailUser" type="text" value="<%=currentSendMailUser%>" size="40" autocomplete="false"/> </td> </tr>
+<input name="sendMailUser" type="text" value="<%=currentSendMailUser%>" size="40" autocomplete="off"/> </td> </tr>
<tr>
<td class="formHeadings">Outgoing Mail Password: </td>
- <td colspan="2"><input name="sendMailPasswd" type="password" value="<%=currentSendMailPasswd%>" size="40" autocomplete="false"/> </td>
+ <td colspan="2"><input name="sendMailPasswd" type="password" value="<%=currentSendMailPasswd%>" size="40" autocomplete="off"/> </td>
</tr>
<tr>
<td class="formHeadings">Default "From" Email Address: </td>
@@ -1371,7 +1396,6 @@
<td colspan="2"> </td>
</tr>
-<!--
<tr>
<td class="formHeadings"></td>
<td colspan="2"><input name="emailEnableManagerComplReport" type="checkbox" value="on" <%="on".equals(currentEmailEnableManagerComplReport)?"checked=\"checked\"":""%> size="40"/><t:t>Manager</t:t> Compliance Report <span style="cursor:pointer;" onclick="showMoreComplReport();" id="moreComplReport">▶ Details...</span></td>
@@ -1424,7 +1448,6 @@
<td> </td>
<td colspan="2"> </td>
</tr>
--->
<tr>
<td>Allow Users To Edit Their Email Address in My Profile</td>
<td colspan="2"><input name="emailEnableUserEdit" type="checkbox" value="on" <%="on".equals(currentEmailEnableUserEdit)?"checked=\"checked\"":""%> size="40"/></td>
@@ -1504,7 +1527,7 @@
</tr>
<tr>
<td>
- <table id="tableFormData2" class="tableFormData">
+ <table id="tableFormData3" class="tableFormData">
<tr>
<td class="formHeadings">Enable: </td>
<td colspan="2"><input name="apiEnable" type="checkbox" value="on" <%="on".equals(currentAPIEnable)?"checked=\"checked\"":""%> size="40"/> </td>
@@ -1534,7 +1557,7 @@
</tr>
<tr>
<td>
- <table id="tableFormData2" class="tableFormData">
+ <table id="tableFormData4" class="tableFormData">
<tr>
<td class="formHeadings">Enable: </td>
<td colspan="2"><input name="srEnable" type="checkbox" value="on" <%="on".equals(currentSREnable)?"checked=\"checked\"":""%> size="40"/> </td>
@@ -1584,13 +1607,13 @@
</table> </td>
</tr>
</table>
- <table cellpadding="0" id="tableFormSR" class="tableForm">
+ <table cellpadding="0" id="tableFormIPR" class="tableForm">
<tr>
<th>Course IP Address Restriction</th>
</tr>
<tr>
<td>
- <table id="tableFormData2" class="tableFormData">
+ <table id="tableFormData5" class="tableFormData">
<tr>
<td class="formHeadings">Enable: </td>
<td colspan="2"><input name="ipEnable" type="checkbox" value="on" <%="on".equals(currentIPEnable)?"checked=\"checked\"":""%> size="40"/> </td>
@@ -1617,7 +1640,7 @@
</tr>
<tr>
<td>
- <table id="tableFormData2" class="tableFormData">
+ <table id="tableFormData6" class="tableFormData">
<tr>
<td class="formHeadings">Enable: </td>
<td colspan="2"><input name="alternativeLoginValidationEnable" type="checkbox" value="on" <%="on".equals(currentAlternativeLoginValidationEnable)?"checked=\"checked\"":""%> size="40"/> </td>
@@ -1646,7 +1669,7 @@
</table>
</form>
<br/>
- <form autocomplete="false" id="announc" method="get" action="admin_systemmanagement.jsp">
+ <form autocomplete="off" id="announc" method="get" action="admin_systemmanagement.jsp">
<table cellpadding="0" cellspacing="0" class="tableMain">
<tr>
<th>Announcements</th>
@@ -1707,7 +1730,7 @@
</table>
</form>
<br />
- <form autocomplete="false" id="resourc" method="get" action="admin_systemmanagement.jsp">
+ <form autocomplete="off" id="resourc" method="get" action="admin_systemmanagement.jsp">
<table cellpadding="0" cellspacing="0" class="tableMain">
<tr>
@@ -1774,6 +1797,78 @@
</tr>
</table>
</form>
+ <br />
+ <table cellpadding="0" id="tableFormCron" class="tableMain">
+ <tr>
+ <th>Scheduled Jobs</th>
+ </tr>
+<!--
+ <tr>
+ <td>
+ <form autocomplete="off" method="get" action="admin_systemmanagement.jsp">
+ <table class="tableDataList">
+ <tr>
+ <td class="formHeadings">Staged Time: </td>
+ <td colspan="3"><%=java.lang.Math.abs(Utils.getNowMillis() - System.currentTimeMillis()) > (1000 * 60) ? df.format(Utils.getNow()) : "[Not Set]"%></td>
+ <tr>
+ <td class="formHeadings">Set Staged Time: </td>
+ <td><input name="stagedTime" value="<%=df.format(Utils.getNow())%>" size="40"/></td>
+ <td>
+ <button name="action" value="setTime" style="horizontal-align: middle; display: block; margin:auto;">Set</button>
+ </td>
+ <td>
+ <button name="action" value="clearTime" style="horizontal-align: middle; display: block; margin:auto;">Clear</button>
+ </td>
+ </tr>
+ </table>
+ </form>
+ </td>
+ </tr>
+-->
+ <tr>
+ <td>
+ <table class="tableDataList">
+ <tr>
+ <th>Job Name</th>
+ <th>Next Run</th>
+ <th></th>
+ </tr>
+<%
+ Scheduler scheduler = new StdSchedulerFactory().getScheduler();
+
+ for (String groupName : scheduler.getJobGroupNames()) {
+
+ for (JobKey jobKey : scheduler.getJobKeys(GroupMatcher.jobGroupEquals(groupName))) {
+
+ String jobName = jobKey.getName();
+ String jobGroup = jobKey.getGroup();
+
+ //get job's trigger
+ List<Trigger> triggers = (List<Trigger>) scheduler.getTriggersOfJob(jobKey);
+ Date nextFireTime = triggers.get(0).getNextFireTime();
+ if (!"JobSchedulingDataLoaderPlugin".equals(jobGroup)) {
+
+%>
+ <tr>
+ <td class="formHeadings"><%=jobName%></td>
+ <td class=""><%=nextFireTime%></td>
+ <td class=""><form autocomplete="off" method="get" action="admin_systemmanagement.jsp">
+ <input type="hidden" name="action" value="runJob">
+ <input type="hidden" name="jobGroup" value="<%=jobGroup%>">
+ <input type="hidden" name="jobName" value="<%=jobName%>">
+ <button style="horizontal-align: middle; display: block; margin:auto;">Run Now</button>
+ </form></td>
+ </tr>
+<%
+ }
+ }
+ }
+%>
+
+ </table>
+ </td>
+ </tr>
+ </table>
</div>
<%@ include file="footer.jsp" %>
</div>
More information about the Ils-source
mailing list