diff options
author | Andrew Wnuk <awnuk@redhat.com> | 2012-09-20 10:35:59 -0700 |
---|---|---|
committer | Andrew Wnuk <awnuk@redhat.com> | 2012-09-20 10:35:59 -0700 |
commit | f944641c33145c6d0999af6d6b91a4dca6c4be23 (patch) | |
tree | b362474a364446446eac99168ac3c540f8a98f0e /dogtag/ca-ui/shared/webapps/ca/agent/ca/reasonToRevoke.template | |
parent | e1666df57fb49b4c2c20563559cd2a7450a6f9f4 (diff) | |
download | pki-f944641c33145c6d0999af6d6b91a4dca6c4be23.tar.gz pki-f944641c33145c6d0999af6d6b91a4dca6c4be23.tar.xz pki-f944641c33145c6d0999af6d6b91a4dca6c4be23.zip |
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.
Diffstat (limited to 'dogtag/ca-ui/shared/webapps/ca/agent/ca/reasonToRevoke.template')
-rw-r--r-- | dogtag/ca-ui/shared/webapps/ca/agent/ca/reasonToRevoke.template | 36 |
1 files changed, 23 insertions, 13 deletions
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 12c14dfda..5752d14de 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: <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> |