397 |
14 Apr 05 |
nicklas |
1 |
<%-- $Id$ |
397 |
14 Apr 05 |
nicklas |
2 |
------------------------------------------------------------------ |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2005 Nicklas Nordborg |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg |
397 |
14 Apr 05 |
nicklas |
5 |
|
2304 |
22 May 06 |
jari |
6 |
This file is part of BASE - BioArray Software Environment. |
2304 |
22 May 06 |
jari |
7 |
Available at http://base.thep.lu.se/ |
397 |
14 Apr 05 |
nicklas |
8 |
|
397 |
14 Apr 05 |
nicklas |
9 |
BASE is free software; you can redistribute it and/or |
397 |
14 Apr 05 |
nicklas |
10 |
modify it under the terms of the GNU General Public License |
4476 |
05 Sep 08 |
jari |
11 |
as published by the Free Software Foundation; either version 3 |
397 |
14 Apr 05 |
nicklas |
12 |
of the License, or (at your option) any later version. |
397 |
14 Apr 05 |
nicklas |
13 |
|
397 |
14 Apr 05 |
nicklas |
14 |
BASE is distributed in the hope that it will be useful, |
397 |
14 Apr 05 |
nicklas |
15 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
397 |
14 Apr 05 |
nicklas |
16 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
397 |
14 Apr 05 |
nicklas |
17 |
GNU General Public License for more details. |
397 |
14 Apr 05 |
nicklas |
18 |
|
397 |
14 Apr 05 |
nicklas |
19 |
You should have received a copy of the GNU General Public License |
4510 |
11 Sep 08 |
jari |
20 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
397 |
14 Apr 05 |
nicklas |
21 |
------------------------------------------------------------------ |
397 |
14 Apr 05 |
nicklas |
22 |
|
397 |
14 Apr 05 |
nicklas |
23 |
A window for selecting a date interactively from a calendar |
397 |
14 Apr 05 |
nicklas |
24 |
|
397 |
14 Apr 05 |
nicklas |
25 |
@param title The title of the input field on the parent form |
6170 |
16 Oct 12 |
nicklas |
26 |
@param textarea The id of the input field containing the current date value |
397 |
14 Apr 05 |
nicklas |
27 |
|
397 |
14 Apr 05 |
nicklas |
28 |
@author Nicklas |
397 |
14 Apr 05 |
nicklas |
29 |
@version 2.0 |
397 |
14 Apr 05 |
nicklas |
30 |
--%> |
5426 |
24 Sep 10 |
nicklas |
31 |
<%@ page pageEncoding="UTF-8" session="false" |
5423 |
23 Sep 10 |
nicklas |
32 |
import="net.sf.basedb.core.SessionControl" |
2753 |
20 Oct 06 |
nicklas |
33 |
import="net.sf.basedb.util.Values" |
5423 |
23 Sep 10 |
nicklas |
34 |
import="net.sf.basedb.clients.web.Base" |
2942 |
22 Nov 06 |
nicklas |
35 |
import="net.sf.basedb.clients.web.util.HTML" |
6216 |
14 Dec 12 |
nicklas |
36 |
import="net.sf.basedb.clients.web.formatter.FormatterSettings" |
1807 |
23 Jan 06 |
nicklas |
37 |
import="java.util.Date" |
1807 |
23 Jan 06 |
nicklas |
38 |
%> |
397 |
14 Apr 05 |
nicklas |
39 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
397 |
14 Apr 05 |
nicklas |
40 |
<% |
5423 |
23 Sep 10 |
nicklas |
41 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
397 |
14 Apr 05 |
nicklas |
42 |
String title = request.getParameter("title"); |
6166 |
11 Oct 12 |
nicklas |
43 |
String textarea = request.getParameter("textarea"); |
6170 |
16 Oct 12 |
nicklas |
44 |
boolean useTime = Values.getBoolean(request.getParameter("useTime")); |
6216 |
14 Dec 12 |
nicklas |
45 |
|
6216 |
14 Dec 12 |
nicklas |
46 |
String format = Values.getString(request.getParameter("format"), useTime ? FormatterSettings.getDateTimeFormat(sc) : FormatterSettings.getDateFormat(sc)); |
397 |
14 Apr 05 |
nicklas |
47 |
%> |
415 |
18 Apr 05 |
nicklas |
48 |
<base:page type="popup" title="<%=title%>"> |
6170 |
16 Oct 12 |
nicklas |
49 |
<base:head styles="calendar.css" scripts="~calendar.js" /> |
6170 |
16 Oct 12 |
nicklas |
50 |
<base:body> |
6170 |
16 Oct 12 |
nicklas |
51 |
<h1><%=title%><base:help helpid="calendar.selectday" /></h1> |
5907 |
13 Dec 11 |
nicklas |
52 |
|
6170 |
16 Oct 12 |
nicklas |
53 |
<div id="page-data" class="datacontainer" |
6170 |
16 Oct 12 |
nicklas |
54 |
data-textarea="<%=textarea%>" |
6170 |
16 Oct 12 |
nicklas |
55 |
data-date-format="<%=HTML.encodeTags(format) %>" |
6170 |
16 Oct 12 |
nicklas |
56 |
data-use-time="<%=useTime ? 1 : 0 %>" |
6170 |
16 Oct 12 |
nicklas |
57 |
></div> |
5907 |
13 Dec 11 |
nicklas |
58 |
|
6162 |
10 Oct 12 |
nicklas |
59 |
<form name="calendar"> |
6607 |
19 Nov 14 |
nicklas |
60 |
<div class="content bg-filled-50 bottomborder"> |
539 |
10 May 05 |
nicklas |
61 |
|
5907 |
13 Dec 11 |
nicklas |
62 |
<div style="position: absolute; top: 0px; left: 0px; right: 0px; height: 2em; text-align: center;"> |
5907 |
13 Dec 11 |
nicklas |
63 |
<table style="height: 100%; margin:auto;"><tr><td> |
6170 |
16 Oct 12 |
nicklas |
64 |
<base:icon image="goback.png" id="prevMonth" /> |
5907 |
13 Dec 11 |
nicklas |
65 |
</td> |
5907 |
13 Dec 11 |
nicklas |
66 |
<td style="width: 15em;"> |
5907 |
13 Dec 11 |
nicklas |
67 |
<b> |
5907 |
13 Dec 11 |
nicklas |
68 |
<span id="month"></span> |
5907 |
13 Dec 11 |
nicklas |
69 |
<span id="year"></span> |
5907 |
13 Dec 11 |
nicklas |
70 |
</b> |
5907 |
13 Dec 11 |
nicklas |
71 |
</td> |
5907 |
13 Dec 11 |
nicklas |
72 |
<td> |
6170 |
16 Oct 12 |
nicklas |
73 |
<base:icon image="gonext.png" id="nextMonth" /> |
5907 |
13 Dec 11 |
nicklas |
74 |
</td></tr></table> |
5907 |
13 Dec 11 |
nicklas |
75 |
</div> |
5907 |
13 Dec 11 |
nicklas |
76 |
|
6170 |
16 Oct 12 |
nicklas |
77 |
<div style="position: absolute; top: 2em; bottom: <%=useTime ? "2" : "1" %>em; width: 100%;"> |
5907 |
13 Dec 11 |
nicklas |
78 |
<table class="calendar"> |
415 |
18 Apr 05 |
nicklas |
79 |
<tr> |
1805 |
23 Jan 06 |
nicklas |
80 |
<td class="day">Mon</td> |
1805 |
23 Jan 06 |
nicklas |
81 |
<td class="day">Tue</td> |
1805 |
23 Jan 06 |
nicklas |
82 |
<td class="day">Wed</td> |
1805 |
23 Jan 06 |
nicklas |
83 |
<td class="day">Thu</td> |
1805 |
23 Jan 06 |
nicklas |
84 |
<td class="day">Fri</td> |
1805 |
23 Jan 06 |
nicklas |
85 |
<td class="day">Sat</td> |
1805 |
23 Jan 06 |
nicklas |
86 |
<td class="day">Sun</td> |
535 |
09 May 05 |
nicklas |
87 |
</tr> |
535 |
09 May 05 |
nicklas |
88 |
<% |
535 |
09 May 05 |
nicklas |
89 |
for (int week = 1; week < 7; ++week) |
535 |
09 May 05 |
nicklas |
90 |
{ |
535 |
09 May 05 |
nicklas |
91 |
%> |
5907 |
13 Dec 11 |
nicklas |
92 |
<tr id="w<%=week%>" style="max-height: 1.5em;"> |
535 |
09 May 05 |
nicklas |
93 |
<% |
535 |
09 May 05 |
nicklas |
94 |
for (int day = 0; day < 7; ++day) |
535 |
09 May 05 |
nicklas |
95 |
{ |
535 |
09 May 05 |
nicklas |
96 |
%> |
539 |
10 May 05 |
nicklas |
97 |
<td id="w<%=week%>d<%=day%>" |
539 |
10 May 05 |
nicklas |
98 |
class="date <%=day==6 ? "sunday" : ""%>" |
6170 |
16 Oct 12 |
nicklas |
99 |
data-week="<%=week%>" data-day="<%=day%>" |
6097 |
03 Sep 12 |
nicklas |
100 |
tabindex="0"><%=day%></td> |
535 |
09 May 05 |
nicklas |
101 |
<% |
535 |
09 May 05 |
nicklas |
102 |
} |
535 |
09 May 05 |
nicklas |
103 |
%> |
535 |
09 May 05 |
nicklas |
104 |
</tr> |
535 |
09 May 05 |
nicklas |
105 |
<% |
535 |
09 May 05 |
nicklas |
106 |
} |
535 |
09 May 05 |
nicklas |
107 |
%> |
415 |
18 Apr 05 |
nicklas |
108 |
</table> |
5423 |
23 Sep 10 |
nicklas |
109 |
</div> |
5423 |
23 Sep 10 |
nicklas |
110 |
<% |
6170 |
16 Oct 12 |
nicklas |
111 |
if (useTime) |
5423 |
23 Sep 10 |
nicklas |
112 |
{ |
5423 |
23 Sep 10 |
nicklas |
113 |
%> |
5907 |
13 Dec 11 |
nicklas |
114 |
<div style="position: absolute; height: 2em; left: 0px; right: 0px; bottom: 0em; text-align: center;"> |
5907 |
13 Dec 11 |
nicklas |
115 |
<table style="height: 100%; margin:auto;"> |
5423 |
23 Sep 10 |
nicklas |
116 |
<tr> |
5423 |
23 Sep 10 |
nicklas |
117 |
<td class="time">Time</td> |
6170 |
16 Oct 12 |
nicklas |
118 |
<td><input class="text" type="text" name="hours" id="hours" title="Hours" maxlength="2" style="width: 2em;">h</td> |
6170 |
16 Oct 12 |
nicklas |
119 |
<td><input class="text" type="text" name="minutes" id="minutes" title="Minutes" maxlength="2" style="width: 2em;">m</td> |
6170 |
16 Oct 12 |
nicklas |
120 |
<td><input class="text" type="text" name="seconds" id="seconds" title="Seconds" maxlength="2" style="width: 2em;">s</td> |
5423 |
23 Sep 10 |
nicklas |
121 |
</tr> |
5423 |
23 Sep 10 |
nicklas |
122 |
</table> |
5907 |
13 Dec 11 |
nicklas |
123 |
</div> |
5423 |
23 Sep 10 |
nicklas |
124 |
<% |
5423 |
23 Sep 10 |
nicklas |
125 |
} |
5423 |
23 Sep 10 |
nicklas |
126 |
%> |
535 |
09 May 05 |
nicklas |
127 |
</div> |
415 |
18 Apr 05 |
nicklas |
128 |
</form> |
5907 |
13 Dec 11 |
nicklas |
129 |
|
5907 |
13 Dec 11 |
nicklas |
130 |
|
5907 |
13 Dec 11 |
nicklas |
131 |
<base:buttongroup subclass="dialogbuttons"> |
6170 |
16 Oct 12 |
nicklas |
132 |
<base:button id="btnToday" image="today.png" title="<%=useTime ? "Now" : "Today"%>" /> |
6170 |
16 Oct 12 |
nicklas |
133 |
<base:button id="btnSave" title="Ok" visible="<%=useTime%>"/> |
6170 |
16 Oct 12 |
nicklas |
134 |
<base:button id="close" title="Cancel" /> |
5423 |
23 Sep 10 |
nicklas |
135 |
</base:buttongroup> |
415 |
18 Apr 05 |
nicklas |
136 |
</base:body> |
397 |
14 Apr 05 |
nicklas |
137 |
</base:page> |