summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Wnuk <awnuk@redhat.com>2012-09-20 10:35:59 -0700
committerAndrew Wnuk <awnuk@redhat.com>2012-09-20 10:35:59 -0700
commitf944641c33145c6d0999af6d6b91a4dca6c4be23 (patch)
treeb362474a364446446eac99168ac3c540f8a98f0e
parente1666df57fb49b4c2c20563559cd2a7450a6f9f4 (diff)
downloadpki-f944641c33145c6d0999af6d6b91a4dca6c4be23.zip
pki-f944641c33145c6d0999af6d6b91a4dca6c4be23.tar.gz
pki-f944641c33145c6d0999af6d6b91a4dca6c4be23.tar.xz
time based searches
This patch removes "fixed" year from time based searches for agent and EE interfaces. It also unifies time selection between search and revocation templates. Bug 854420.
-rw-r--r--dogtag/ca-ui/shared/webapps/ca/agent/ca/SrchCert.html184
-rw-r--r--dogtag/ca-ui/shared/webapps/ca/agent/ca/SrchRevokeCert.html138
-rw-r--r--dogtag/ca-ui/shared/webapps/ca/agent/ca/reasonToRevoke.template36
-rw-r--r--dogtag/ca-ui/shared/webapps/ca/agent/funcs.js43
-rw-r--r--dogtag/ca-ui/shared/webapps/ca/ee/ca/reasonToRevoke.template38
-rw-r--r--dogtag/ca-ui/shared/webapps/ca/ee/ca/srchCert.html184
-rw-r--r--dogtag/ca-ui/shared/webapps/ca/ee/cms-funcs.js43
7 files changed, 254 insertions, 412 deletions
diff --git a/dogtag/ca-ui/shared/webapps/ca/agent/ca/SrchCert.html b/dogtag/ca-ui/shared/webapps/ca/agent/ca/SrchCert.html
index 2735028..525142a 100644
--- a/dogtag/ca-ui/shared/webapps/ca/agent/ca/SrchCert.html
+++ b/dogtag/ca-ui/shared/webapps/ca/agent/ca/SrchCert.html
@@ -367,7 +367,7 @@ Show certificates revoked by:</font>&nbsp;
<tr>
<FORM NAME="revokedOnCritForm">
<td>
-<INPUT TYPE="CHECKBOX" NAME="inUse">
+<INPUT TYPE="CHECKBOX" NAME="inUse" onClick="clickedOnTimeRangeCheckBox(document.revokedOnCritForm.inUse, document.revokedOnFrom, document.revokedOnTo);">
</td>
<td align="left" colspan="2">
<font size=-1 face="PrimaSans BT, Verdana, sans-serif">
@@ -433,23 +433,11 @@ Show certificates revoked during the period:</font>
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 1);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
@@ -512,23 +500,11 @@ Show certificates revoked during the period:</font>
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 1);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
@@ -697,7 +673,7 @@ Show certificates issued according to the profile:</font>&nbsp;
<tr>
<FORM NAME="issuedOnCritForm">
-<td><INPUT TYPE="CHECKBOX" NAME="inUse"></td>
+<td><INPUT TYPE="CHECKBOX" NAME="inUse" onClick="clickedOnTimeRangeCheckBox(document.issuedOnCritForm.inUse, document.issuedOnFrom, document.issuedOnTo);"></td>
<td colspan="2">
<font size=-1 face="PrimaSans BT, Verdana, sans-serif">
Show certificates issued during the period:</font></td>
@@ -761,23 +737,11 @@ Show certificates issued during the period:</font></td>
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 1);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
@@ -840,23 +804,11 @@ Show certificates issued during the period:</font></td>
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 1);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
@@ -961,7 +913,7 @@ function issuedOnCrit()
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<FORM NAME="validNotBeforeCritForm">
-<td><INPUT TYPE="CHECKBOX" NAME="inUse"></td>
+<td><INPUT TYPE="CHECKBOX" NAME="inUse" onClick="clickedOnTimeRangeCheckBox(document.validNotBeforeCritForm.inUse, document.validNotBeforeFrom, document.validNotBeforeTo);"></td>
<td align="left" colspan="2">
<font size=-1 face="PrimaSans BT, Verdana, sans-serif">
Show certificates effective during the period:</font></td>
@@ -1025,23 +977,11 @@ Show certificates effective during the period:</font></td>
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 10);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
@@ -1104,23 +1044,11 @@ Show certificates effective during the period:</font></td>
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 10);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
@@ -1180,7 +1108,7 @@ function validNotBeforeCrit()
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<FORM NAME="validNotAfterCritForm">
-<td><INPUT TYPE="CHECKBOX" NAME="inUse"></td>
+<td><INPUT TYPE="CHECKBOX" NAME="inUse" onClick="clickedOnTimeRangeCheckBox(document.validNotAfterCritForm.inUse, document.validNotAfterFrom, document.validNotAfterTo);"></td>
<td align="left" colspan="2">
<font size=-1 face="PrimaSans BT, Verdana, sans-serif">
Show certificates expired during the period:</font></td>
@@ -1244,23 +1172,11 @@ Show certificates expired during the period:</font></td>
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 10);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
@@ -1323,23 +1239,11 @@ Show certificates expired during the period:</font></td>
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 10);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
diff --git a/dogtag/ca-ui/shared/webapps/ca/agent/ca/SrchRevokeCert.html b/dogtag/ca-ui/shared/webapps/ca/agent/ca/SrchRevokeCert.html
index 7138410..b67f992 100644
--- a/dogtag/ca-ui/shared/webapps/ca/agent/ca/SrchRevokeCert.html
+++ b/dogtag/ca-ui/shared/webapps/ca/agent/ca/SrchRevokeCert.html
@@ -334,7 +334,7 @@ Revoke certificates issued by:</font>&nbsp;
<tr>
<FORM NAME="issuedOnCritForm">
-<td><INPUT TYPE="CHECKBOX" NAME="inUse"></td>
+<td><INPUT TYPE="CHECKBOX" NAME="inUse" onClick="clickedOnTimeRangeCheckBox(document.issuedOnCritForm.inUse, document.issuedOnFrom, document.issuedOnTo);"></td>
<td colspan="2">
<font size=-1 face="PrimaSans BT, Verdana, sans-serif">
Revoke certificates issued during the period:</font>
@@ -399,23 +399,11 @@ Revoke certificates issued during the period:</font>
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 1);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
@@ -478,23 +466,11 @@ Revoke certificates issued during the period:</font>
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 1);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
@@ -579,7 +555,7 @@ function issuedOnCrit()
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<FORM NAME="validNotBeforeCritForm">
-<td><INPUT TYPE="CHECKBOX" NAME="inUse"></td>
+<td><INPUT TYPE="CHECKBOX" NAME="inUse" onClick="clickedOnTimeRangeCheckBox(document.validNotBeforeCritForm.inUse, document.validNotBeforeFrom, document.validNotBeforeTo);"></td>
<td align="left" colspan="2">
<font size=-1 face="PrimaSans BT, Verdana, sans-serif">
Revoke certificates effective during the period:</font>
@@ -644,23 +620,11 @@ Revoke certificates effective during the period:</font>
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 10);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
@@ -723,23 +687,11 @@ Revoke certificates effective during the period:</font>
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 10);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
@@ -798,7 +750,7 @@ function validNotBeforeCrit()
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<FORM NAME="validNotAfterCritForm">
-<td><INPUT TYPE="CHECKBOX" NAME="inUse"></td>
+<td><INPUT TYPE="CHECKBOX" NAME="inUse" onClick="clickedOnTimeRangeCheckBox(document.validNotAfterCritForm.inUse, document.validNotAfterFrom, document.validNotAfterTo);"></td>
<td align="left" colspan="2">
<font size=-1 face="PrimaSans BT, Verdana, sans-serif">
Revoke certificates expire during the period:</font>
@@ -863,23 +815,11 @@ Revoke certificates expire during the period:</font>
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 10);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
@@ -942,23 +882,11 @@ Revoke certificates expire during the period:</font>
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 10);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
diff --git a/dogtag/ca-ui/shared/webapps/ca/agent/ca/reasonToRevoke.template b/dogtag/ca-ui/shared/webapps/ca/agent/ca/reasonToRevoke.template
index 12c14df..5752d14 100644
--- a/dogtag/ca-ui/shared/webapps/ca/agent/ca/reasonToRevoke.template
+++ b/dogtag/ca-ui/shared/webapps/ca/agent/ca/reasonToRevoke.template
@@ -32,7 +32,7 @@ function validate()
var filter = "(|";
var n = 0;
- if (!dateIsEmpty(document.forms[0])) {
+ if (document.forms[0].invalidityEnabled.checked) {
var d = convertDate(document.forms[0], "Invalidity Date");
if (d == null) return false;
document.forms[0].invalidityDate.value = d;
@@ -76,6 +76,26 @@ function validate()
return true;
}
+function clickedOnInvalidityEnabled()
+{
+ if (document.forms[0].invalidityEnabled.checked) {
+ var date = new Date();
+ if (document.forms[0].day.options[document.forms[0].day.selectedIndex].value == 0) {
+ document.forms[0].day.selectedIndex = date.getDate();
+ }
+ if (document.forms[0].month.options[document.forms[0].month.selectedIndex].value == 13) {
+ document.forms[0].month.selectedIndex = date.getMonth() +1;
+ }
+ if (document.forms[0].year.options[document.forms[0].year.selectedIndex].value == 0) {
+ for (var i = 0; i < document.forms[0].year.options.length; i++) {
+ if (document.forms[0].year.options[i].value == date.getFullYear()) {
+ document.forms[0].year.selectedIndex = i;
+ }
+ }
+ }
+ }
+}
+
function toHex1(number)
{
var absValue = "", sign = "";
@@ -287,6 +307,7 @@ if (result.recordSet.length == 0) {
</tr>
<tr>
<td valign="TOP" colspan="2">
+ <INPUT TYPE="CHECKBOX" NAME="invalidityEnabled" onClick="clickedOnInvalidityEnabled();">
<font face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif" size="-1">
Invalidity date:&nbsp;
<SELECT NAME="day">
@@ -339,20 +360,9 @@ if (result.recordSet.length == 0) {
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
- <OPTION VALUE=0>
<SCRIPT type="text/javascript">
//<!--
- var today = new Date();
- var year = today.getYear();
- if (year < 100) {
- year += 1900;
- } else {
- year %= 100;
- year += 2000;
- }
- for (var i = year-7; i < year+5; i++) {
- document.writeln("<OPTION VALUE="+i+">"+i);
- }
+generateYearOptions(10, 2);
//-->
</SCRIPT>
</SELECT>
diff --git a/dogtag/ca-ui/shared/webapps/ca/agent/funcs.js b/dogtag/ca-ui/shared/webapps/ca/agent/funcs.js
index f610759..958612d 100644
--- a/dogtag/ca-ui/shared/webapps/ca/agent/funcs.js
+++ b/dogtag/ca-ui/shared/webapps/ca/agent/funcs.js
@@ -403,6 +403,49 @@ function daysToSeconds(days){
return 3600 * 24 * days;
}
+function clickedOnTimeRangeCheckBox(inUse, start, end)
+{
+ if (inUse.checked) {
+ var date = new Date();
+ if (start.day.options[start.day.selectedIndex].value == 0) {
+ start.day.selectedIndex = date.getDate();
+ }
+ if (end.day.options[end.day.selectedIndex].value == 0) {
+ end.day.selectedIndex = date.getDate();
+ }
+ if (start.month.options[start.month.selectedIndex].value == 13) {
+ start.month.selectedIndex = date.getMonth() + 1;
+ }
+ if (end.month.options[end.month.selectedIndex].value == 13) {
+ end.month.selectedIndex = date.getMonth() + 1;
+ }
+ if (start.year.options[start.year.selectedIndex].value == 0) {
+ for (var i = 0; i < start.year.options.length; i++) {
+ if (start.year.options[i].value == date.getFullYear()) {
+ start.year.selectedIndex = i;
+ }
+ }
+ }
+ if (end.year.options[end.year.selectedIndex].value == 0) {
+ for (var i = 0; i < end.year.options.length; i++) {
+ if (end.year.options[i].value == date.getFullYear()) {
+ end.year.selectedIndex = i;
+ }
+ }
+ }
+ }
+}
+
+function generateYearOptions(before, after)
+{
+ var now = new Date();
+ var year = now.getFullYear();
+ document.writeln("<OPTION VALUE=0>");
+ for (var i = year-before-1; i < year+after+1; i++) {
+ document.writeln("<OPTION VALUE="+i+">"+i);
+ }
+}
+
// encloses value in double quotes preceding all embedded double quotes with \
function escapeValue(value)
{
diff --git a/dogtag/ca-ui/shared/webapps/ca/ee/ca/reasonToRevoke.template b/dogtag/ca-ui/shared/webapps/ca/ee/ca/reasonToRevoke.template
index 6d2edf1..b8b161a 100644
--- a/dogtag/ca-ui/shared/webapps/ca/ee/ca/reasonToRevoke.template
+++ b/dogtag/ca-ui/shared/webapps/ca/ee/ca/reasonToRevoke.template
@@ -33,7 +33,7 @@ function validate()
var filter = "(|";
var n = 0;
- if (!dateIsEmpty(document.forms[0])) {
+ if (document.forms[0].invalidityEnabled.checked) {
var d = convertDate(document.forms[0], "Invalidity Date");
if (d == null) return false;
document.forms[0].invalidityDate.value = d;
@@ -77,6 +77,26 @@ function validate()
return true;
}
+function clickedOnInvalidityEnabled()
+{
+ if (document.forms[0].invalidityEnabled.checked) {
+ var date = new Date();
+ if (document.forms[0].day.options[document.forms[0].day.selectedIndex].value == 0) {
+ document.forms[0].day.selectedIndex = date.getDate();
+ }
+ if (document.forms[0].month.options[document.forms[0].month.selectedIndex].value == 13) {
+ document.forms[0].month.selectedIndex = date.getMonth() +1;
+ }
+ if (document.forms[0].year.options[document.forms[0].year.selectedIndex].value == 0) {
+ for (var i = 0; i < document.forms[0].year.options.length; i++) {
+ if (document.forms[0].year.options[i].value == date.getFullYear()) {
+ document.forms[0].year.selectedIndex = i;
+ }
+ }
+ }
+ }
+}
+
function toHex1(number)
{
var absValue = "", sign = "";
@@ -283,6 +303,7 @@ if (result.recordSet.length == 0) {
</tr>
<tr>
<td valign="TOP" colspan="2">
+ <INPUT TYPE="CHECKBOX" NAME="invalidityEnabled" onClick="clickedOnInvalidityEnabled();">
<font face="PrimaSans BT, Verdana, Arial, Helvetica, sans-serif" size="-1">
Invalidity date:&nbsp;
<SELECT NAME="day">
@@ -335,20 +356,9 @@ if (result.recordSet.length == 0) {
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
- <OPTION VALUE=0>
-<SCRIPT LANGUAGE="JavaScript">
+<SCRIPT type="text/javascript">
//<!--
- var today = new Date();
- var year = today.getYear();
- if (year < 100) {
- year += 1900;
- } else {
- year %= 100;
- year += 2000;
- }
- for (var i = year-7; i < year+5; i++) {
- document.writeln("<OPTION VALUE="+i+">"+i);
- }
+generateYearOptions(10, 2);
//-->
</SCRIPT>
</SELECT>
diff --git a/dogtag/ca-ui/shared/webapps/ca/ee/ca/srchCert.html b/dogtag/ca-ui/shared/webapps/ca/ee/ca/srchCert.html
index a1ef565..2a4b3a9 100644
--- a/dogtag/ca-ui/shared/webapps/ca/ee/ca/srchCert.html
+++ b/dogtag/ca-ui/shared/webapps/ca/ee/ca/srchCert.html
@@ -345,7 +345,7 @@ Show certificates revoked by:
<tr>
<FORM NAME="revokedOnCritForm">
<td>
-<INPUT TYPE="CHECKBOX" NAME="inUse">
+<INPUT TYPE="CHECKBOX" NAME="inUse" onClick="clickedOnTimeRangeCheckBox(document.revokedOnCritForm.inUse, document.revokedOnFrom, document.revokedOnTo);">
</td>
<td align="left" colspan="2">
<font size=-1 face="PrimaSans BT, Verdana, sans-serif">
@@ -411,23 +411,11 @@ Show certificates revoked during the period:</font>
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 1);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
@@ -490,23 +478,11 @@ Show certificates revoked during the period:</font>
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 1);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
@@ -667,7 +643,7 @@ Show certificates issued by:
<tr>
<FORM NAME="issuedOnCritForm">
-<td><INPUT TYPE="CHECKBOX" NAME="inUse"></td>
+<td><INPUT TYPE="CHECKBOX" NAME="inUse" onClick="clickedOnTimeRangeCheckBox(document.issuedOnCritForm.inUse, document.issuedOnFrom, document.issuedOnTo);"></td>
<td colspan="2"><font size=-1 face="PrimaSans BT, Verdana, sans-serif">
Show certificates issued during the period:</font></td>
</FORM>
@@ -730,23 +706,11 @@ Show certificates issued during the period:</font></td>
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 1);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
@@ -809,23 +773,11 @@ Show certificates issued during the period:</font></td>
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 1);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
@@ -912,7 +864,7 @@ function issuedOnCrit()
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<FORM NAME="validNotBeforeCritForm">
-<td><INPUT TYPE="CHECKBOX" NAME="inUse"></td>
+<td><INPUT TYPE="CHECKBOX" NAME="inUse" onClick="clickedOnTimeRangeCheckBox(document.validNotBeforeCritForm.inUse, document.validNotBeforeFrom, document.validNotBeforeTo);"></td>
<td align="left" colspan="2">
<font size=-1 face="PrimaSans BT, Verdana, sans-serif">
Show certificates effective during the period:
@@ -977,23 +929,11 @@ Show certificates effective during the period:
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 10);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
@@ -1056,23 +996,11 @@ Show certificates effective during the period:
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 10);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
@@ -1132,7 +1060,7 @@ function validNotBeforeCrit()
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<FORM NAME="validNotAfterCritForm">
-<td><INPUT TYPE="CHECKBOX" NAME="inUse"></td>
+<td><INPUT TYPE="CHECKBOX" NAME="inUse" onClick="clickedOnTimeRangeCheckBox(document.validNotAfterCritForm.inUse, document.validNotAfterFrom, document.validNotAfterTo);"></td>
<td align="left" colspan="2">
<font size=-1 face="PrimaSans BT, Verdana, sans-serif">
Show certificates expired during the period: </font></td>
@@ -1196,23 +1124,11 @@ Show certificates expired during the period: </font></td>
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 10);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
@@ -1275,23 +1191,11 @@ Show certificates expired during the period: </font></td>
<OPTION VALUE=11>December
</SELECT>
<SELECT NAME="year">
-<OPTION VALUE=0>
-<OPTION VALUE=1997>1997
-<OPTION VALUE=1998>1998
-<OPTION VALUE=1999>1999
-<OPTION VALUE=2000>2000
-<OPTION VALUE=2001>2001
-<OPTION VALUE=2002>2002
-<OPTION VALUE=2003>2003
-<OPTION VALUE=2004>2004
-<OPTION VALUE=2005>2005
-<OPTION VALUE=2006>2006
-<OPTION VALUE=2007>2007
-<OPTION VALUE=2008>2008
-<OPTION VALUE=2009>2009
-<OPTION VALUE=2010>2010
-<OPTION VALUE=2011>2011
-<OPTION VALUE=2012>2012
+<SCRIPT type="text/javascript">
+//<!--
+generateYearOptions(10, 10);
+//-->
+</SCRIPT>
</SELECT>
</FORM>
</td>
diff --git a/dogtag/ca-ui/shared/webapps/ca/ee/cms-funcs.js b/dogtag/ca-ui/shared/webapps/ca/ee/cms-funcs.js
index 800e4af..601a842 100644
--- a/dogtag/ca-ui/shared/webapps/ca/ee/cms-funcs.js
+++ b/dogtag/ca-ui/shared/webapps/ca/ee/cms-funcs.js
@@ -337,6 +337,49 @@ function daysToSeconds(days){
return 3600 * 24 * days;
}
+function clickedOnTimeRangeCheckBox(inUse, start, end)
+{
+ if (inUse.checked) {
+ var date = new Date();
+ if (start.day.options[start.day.selectedIndex].value == 0) {
+ start.day.selectedIndex = date.getDate();
+ }
+ if (end.day.options[end.day.selectedIndex].value == 0) {
+ end.day.selectedIndex = date.getDate();
+ }
+ if (start.month.options[start.month.selectedIndex].value == 13) {
+ start.month.selectedIndex = date.getMonth() + 1;
+ }
+ if (end.month.options[end.month.selectedIndex].value == 13) {
+ end.month.selectedIndex = date.getMonth() + 1;
+ }
+ if (start.year.options[start.year.selectedIndex].value == 0) {
+ for (var i = 0; i < start.year.options.length; i++) {
+ if (start.year.options[i].value == date.getFullYear()) {
+ start.year.selectedIndex = i;
+ }
+ }
+ }
+ if (end.year.options[end.year.selectedIndex].value == 0) {
+ for (var i = 0; i < end.year.options.length; i++) {
+ if (end.year.options[i].value == date.getFullYear()) {
+ end.year.selectedIndex = i;
+ }
+ }
+ }
+ }
+}
+
+function generateYearOptions(before, after)
+{
+ var now = new Date();
+ var year = now.getFullYear();
+ document.writeln("<OPTION VALUE=0>");
+ for (var i = year-before-1; i < year+after+1; i++) {
+ document.writeln("<OPTION VALUE="+i+">"+i);
+ }
+}
+
// encloses value in double quotes preceding all embedded double quotes with \
function escapeValue(value)
{