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/ee/cms-funcs.js | |
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/ee/cms-funcs.js')
-rw-r--r-- | dogtag/ca-ui/shared/webapps/ca/ee/cms-funcs.js | 43 |
1 files changed, 43 insertions, 0 deletions
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 800e4afc9..601a84221 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) { |